CakePHP注销问题 [英] CakePHP Logout issues
问题描述
我知道这必须是真的很蠢,但我有退出的问题。我仍然可以看到完整的用户Auth变量调用Auth-> logout()后。在我的用户控制器中,我有标准:
function login()
{
} $ b b
function logout()
{
$ this-> redirect($ this-> Auth-> logout());
}
但是当我调用logout时,在我看来,这样做:
$ auth = $ this-> Session-> read('Auth.User');
print< pre>;
print_r($ auth);
print< / pre>;
我缺少一些基本的东西吗?感谢!
您不允许使用注销功能,用户被重定向而不是注销。 p>
在您的控制器中包含注销功能,请将其添加到您的过滤器中:
$ this-> Auth-> allow('logout');
I know this must be something really stupid, but I am having issues with logging out. I can still see the full user Auth variable after calling Auth->logout(). In my users controller I have the standard:
function login()
{
}
function logout()
{
$this->redirect($this->Auth->logout());
}
But when I call logout, in my view I can still print the User by doing this:
$auth = $this->Session->read('Auth.User');
print "<pre>";
print_r($auth);
print "</pre>";
Am I missing something basic here? Thanks!
you have not allowed the use of the logout function, and the user is redirected instead of logged out.
in your controller containing logout the function, add this in your before filter:
$this->Auth->allow('logout');
这篇关于CakePHP注销问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!