【问题标题】:(CakePHP on WAMP) page hangs on load only in IE(WAMP 上的 CakePHP)页面仅在 IE 中加载时挂起
【发布时间】:2013-07-17 21:35:57
【问题描述】:

我正在使用 CakePHP 开发一个应用程序,并且一直在使用 Firefox 对其进行调试。一切都很好,直到我决定用 IE 测试它并遇到一些非常奇怪的行为。有时页面不会在 IE 中加载,它们只会以加载状态坐在那里。挂起的页面非常简单,仅使用 CakePHP 的 Html 帮助器创建单个表单并使用 AuthComponent::User() 进行检查(查看用户是否已登录)。我相信这个问题与会话有关。假设我要在 IE 中打开该页面,但实际上它确实挂起,我无法在 Firefox 中查看该页面,直到我在 IE 中停止连接。

同样,这个问题在 Firefox 中不会发生。我已经尝试过SessionId cookie in CakePHP causing the page to hang 中发布的修复,但没有成功。

更新:我刚刚安装了 XDebug。我在我的 webroot 目录中 index.php 的开头调用了 xdebug_break() 。当 IE 中的请求挂起时,永远不会触发此断点。我现在怀疑 WAMP 出了问题?

这是引起关注的代码,这是在我的根控制器中,所有其他控制器都扩展了。

public function beforeFilter()
{
    if($this->Auth->user())
    {
        if($this->Auth->user('roles') == 'admin')
            $this->layout = 'admin';
        else if($this->Auth->user('roles') == 'partner')
            $this->layout = 'partner';
        else if($this->Auth->user('roles') == 'user')
            $this->layout = 'user';
    }

    $this->set('currentController', $this->request['controller']);
    $this->set('username', $this->Auth->user('username'));
}

【问题讨论】:

    标签: php session cakephp


    【解决方案1】:

    看起来这是 Apache 的问题。

    添加解决

    AcceptFilter http none
    AcceptFilter https none
    

    到我的 httpd.conf

    http://forums.laravel.io/viewtopic.php?id=7920

    【讨论】:

      猜你喜欢
      • 2012-03-07
      • 2011-10-18
      • 2022-01-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-17
      • 2014-05-20
      • 1970-01-01
      相关资源
      最近更新 更多