【问题标题】:Cakephp 2.x Auth not working in Chrome 74.0 version but its working in mozilla 66.0 versionCakephp 2.x Auth 在 Chrome 74.0 版本中不起作用,但在 mozilla 66.0 版本中起作用
【发布时间】:2019-05-23 04:39:15
【问题描述】:

这是我今天面临的关键问题。我的 Cakephp 项目无法与 chrome、safari 保持会话,它在 mozilla 中的工作位置

public function login()
{
    $this->layout = 'login';

    if ($this->request->is('post'))
    {
        if ($this->Auth->login())
        {
            $this->authUser = AppModel::$authUser = $this->Auth->user();                    
        }
        else
        {
            $this->Session->setFlash('Username or password was incorrect.', 'flash_failure');
        }
    }

    if ($this->authUser)
    {
        $menus = Menu::get(Menu::$default, $this->Acl, $this->authUser['group_id']);

        $home_link = Menu::getDefaultLink($menus);

        //debug($_SESSION); debug($_COOKIE); debug($home_link); debug($this->authUser); exit;

        $this->redirect($home_link);
    }
}

登录后我检查$this->authUser。它在这里工作正常。但它会重定向到 $home_link。它让我重新登录。然后我检查会话我没有找到 auth.user 会话中的密钥

【问题讨论】:

    标签: php cakephp


    【解决方案1】:

    我遇到了同样的问题 请删除调试工具包插件,然后从 chrome 及其工作中删除所有 cookie 和缓存。

    【讨论】:

      猜你喜欢
      • 2023-03-13
      • 2018-07-29
      • 2021-05-22
      • 2018-07-13
      • 2019-04-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-25
      相关资源
      最近更新 更多