PHP cakephp有奇怪的会话问题

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP cakephp有奇怪的会话问题相关的知识,希望对你有一定的参考价值。

First visit. No session, no cookies so far.

$_COOKIE: 
Array()

$_SESSION: 
Array
(
    [Config] => Array
        (
            [rand] => 2031703447
            [time] => 1166640164
            [userAgent] => 05c06381cba0c03d1fda664faf636fab
        )

)

SID: WEGNERDE=4068f91034bca9992f4e86fb555b3997

sessioncomponent Object
(
    [_log] => 
    [CakeSession] => cakesession Object
        (
            [_log] => 
            [valid] => 1
            [error] => Array
                (
                    [2] => Config doesn't exist
                    [1] => Session is valid
                )

            [_userAgent] => 05c06381cba0c03d1fda664faf636fab
            [path] => /index.php/
            [lastError] => 1
            [security] => high
            [time] => 1166638964
            [sessionTime] => 1166640164
            [host] => www.[snip].de
            [cookieLifeTime] => 0
        )

    [base] => /index.php
    [webroot] => /wegner/webroot/
    [here] => /index.php/nodes/view/18
    [params] => Array
        (
            [controller] => nodes
            [action] => view
            [pass] => Array
                (
                    [0] => 18
                )

            [form] => Array
                (
                )

            [url] => Array
                (
                    [url] => /nodes/view/18
                )

            [bare] => 0
            [webservices] => 
            [plugin] => 
        )

    [action] => view
    [data] => 
    [plugin] => 
)

DB:
select '4068f91034bca9992f4e86fb555b3997', zero results
insert row with id '4068f91034bca9992f4e86fb555b3997'

===================
Second page visit
===================

$_COOKIE:
Array
(
    [WEGNERDE] => 4068f91034bca9992f4e86fb555b3997
)

$_SESSION:
Array
(
    [Config] => Array
        (
            [rand] => 724195738
            [time] => 1166640598
            [userAgent] => 05c06381cba0c03d1fda664faf636fab
        )

)

SID: (empty)

sessioncomponent Object
(
    [_log] => 
    [CakeSession] => cakesession Object
        (
            [_log] => 
            [valid] => 1
            [error] => Array
                (
                    [2] => Config doesn't exist
                    [1] => Session is valid
                )

            [_userAgent] => 05c06381cba0c03d1fda664faf636fab
            [path] => /index.php/
            [lastError] => 1
            [security] => high
            [time] => 1166639398
            [sessionTime] => 1166640598
            [host] => www.[snip].de
            [cookieLifeTime] => 0
        )

    [base] => /index.php
    [webroot] => /wegner/webroot/
    [here] => /index.php/users/login
    [params] => Array
        (
            [controller] => users
            [action] => login
            [form] => Array
                (
                )

            [url] => Array
                (
                    [url] => /users/login
                )

            [bare] => 0
            [webservices] => 
            [plugin] => 
        )

    [action] => login
    [data] => 
    [plugin] => 
)


DB:
select id 'c2042ca664205240f5e327762e615d72', 0 results
insert new row with id = c2042ca664205240f5e327762e615d72

以上是关于PHP cakephp有奇怪的会话问题的主要内容,如果未能解决你的问题,请参考以下文章

cakephp 3如何增加会话超时

CakePHP - 会话超时

markdown [php:SSO]单个登录在memcached共享会话的多个服务器上。 #php #cakephp #linux

在 cakephp 中延长每个用户的会话超时

Cakephp v 0.2.9会话在24分钟后到期

如何在 cakephp 中获取 $_SESSION 值