CakePHP:在非对象上调用成员函数 setFlash()
我在尝试注销我的 CakePHP 应用程序时收到以下错误:
Notice (8): Undefined property: UsersController::$Session [APP/controllers/users_controller.php, line 75]
Fatal error: Call to a member function setFlash() on a non-object in /Users/cameron/Sites/cakeapp/app/controllers/users_controller.php on line 75
这是第 74、75 和 76 行的代码:
function logout() {
$this->Session->setFlash('Good-Bye');
$this->redirect($this->Auth->logout());
}