开发者

cakephp "Config doesnt exist" in session

I am using the Cake's inbuilt auth module . Everything is working fine on my production environment . However on my local environment , I am not able to login .

I traced out that the problem is because the sessions seems to get 开发者_运维问答reset on every redirect . As a result of which cake is not able to find one of it's array ( Config) in the session variable .

I have tried setting the security level to medium/low , but to no use .

Please help.

This is what my session object looks like :

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
)


Ok . I solved it . It had to do with the permissions of my folders on the local environment . I hope this post helps somebody .


This could also be because your website was loaded from some other server or email link or something.

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.

The only difference I can determine between security medium and security low is timeout duration and setting the php session.referer_check.

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

Hope this helps someone in need.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜