Cakephp会话不会在不清除缓存的情况下删除


cakephp session is not deleting without clearing cache

注销时,我的cakphp会话没有被删除。在注销功能中,我也从Facebook注销了用户。在调用注销功能后,它将用户从Facebook注销,但不会从网站注销。要从网站注销,我必须点击注销按钮,然后清除缓存(ctrl +r),以获得注销工作。谁能告诉我我哪里错了?

function logout()
{
    $this->Session->delete("SESSION_USER");
    $this->Session->delete('logout'); 
    $this->redirect(BASE_URL);
}

try doing:

function logout() {
   $this->Session->destroy();
   $this->redirect($this->Auth->logout());
}

并将此(如果尚未添加)添加到您的beforeFilter()方法中::

$this->Auth->allow('logout');