【问题标题】:cakephp session is not deleting without clearing cachecakephp 会话在不清除缓存的情况下不会删除
【发布时间】:2014-06-09 07:51:59
【问题描述】:

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

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

【问题讨论】:

  • I have to click on logout button and then clear the [browser] cache - 你看错了问题。用户 is 已注销,他们正在查看一个陈旧的页面,因为该页面提供了缓存标头。

标签: php session cakephp


【解决方案1】:

尝试做:

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

并在您的beforeFilter() 方法中添加这个(如果尚未添加)::

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

【讨论】:

    猜你喜欢
    • 2020-10-21
    • 1970-01-01
    • 2017-07-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-08
    • 1970-01-01
    • 2011-01-14
    相关资源
    最近更新 更多