【问题标题】:cakephp "Config doesnt exist" in session会话中的cakephp“配置不存在”
【发布时间】:2011-03-12 18:11:32
【问题描述】:

我正在使用 Cake 的内置身份验证模块。在我的生产环境中一切正常。但是在我的本地环境中,我无法登录。
我发现问题是因为会话似乎在每次重定向时都会重置。结果 which cake 无法在会话变量中找到它的数组 (Config) 之一。
我尝试将安全级别设置为中/低,但没有用。

请帮忙。

这是我的会话对象的样子:

SessionComponent Object
(
    [__active] => 1
    [__started] => 1
    [__bare] => 0
    [valid] => 1
    [error] => Array
        (
            [2] => Config doesn't exist

            [1] => Session is valid
        )

    [_userAgent] => 
    [path] => /
    [lastError] => 1
    [security] => low
    [time] => 1278498179
    [sessionTime] => 1282098179

    [watchKeys] => Array
        (
        )

    [id] => 
    [_log] => 
    [host] => localhost
    [enabled] => 1
    [cookieLifeTime] => 788940000
)

【问题讨论】:

    标签: cakephp


    【解决方案1】:

    好的。我解决了。这与我的文件夹在本地环境中的权限有关。 我希望这篇文章对某人有所帮助。

    【讨论】:

      【解决方案2】:

      这也可能是因为您的网站是从其他服务器或电子邮件链接或其他内容加载的。

      One common problem is if the link you are following is from a
      different HOST the php session has a session.referer_check which is
      set to the HTTPS_HOST for security high and to HTTP_HOST for security
      medium, it is not set for security low. This causes the session to be
      reset if the referer is not the host that is being called. In other
      words if you followed a link from an email or some other server that
      points to your app. This also presents when going back and forth
      between the root app/domain and a root/sub app/domain because the the
      HTTP_HOST can changes (if one site is using blah.blah.com and the
      other is using localhost or ip address)
      Often we all have code to read in a cookie to remember a user that has
      previously logged in. This often just masks and hides the problem. So
      we don't notice most of the time when the session was dropped until we
      start to rely on a saved value that we thought we saved to the session
      or when the user cookie expires and we are redirected to the login
      page. So these often times appear very random when in reality they are
      not. If your having what appears to be intermediate session lost, its
      very likely its occurring more than you think. Some debugging is
      needed.
      

      我可以确定的安全介质和安全介质之间的唯一区别 安全性低是超时持续时间和设置 php session.referer_check。

      来源:http://cakephp.1045679.n5.nabble.com/Auth-losting-authentication-with-no-reason-td1331403.html

      希望这对有需要的人有所帮助。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2014-09-23
        • 1970-01-01
        • 1970-01-01
        • 2013-06-27
        • 1970-01-01
        • 2012-09-30
        • 2017-11-19
        相关资源
        最近更新 更多