0

错误:无法取消设置字符串偏移
文件:/var/www/lib/Cake/Controller/Component/AuthComponent.php
行:781

代码:

if (isset($this->request->data['User'])) { $this->Auth->login(); }

知道为什么会发生此错误吗?

4

1 回答 1

0

在 AppController.php 内部

public $components = array(
    'Session',
    'Auth' => array(
        'loginRedirect' => array(
            'controller' => 'pages',
            'action' => 'display',
            'home'
        ),
        'logoutRedirect' => array(
            'controller' => 'pages',
            'action' => 'display',
            'home'
        ),
        'authError' => 'You must be logged in to view this page.',
        'loginError' => 'Invalid Username or Password.',
        'authenticate' => array(
            'passwordHasher' => 'Blowfish',
        )
    )
);

需要进行身份验证

'authenticate' => array(
    'Form' => array(
        'passwordHasher' => 'Blowfish',
    )
) 
于 2014-08-28T19:33:21.070 回答