我有一个使用本机会话用 Kohana 3.0 编写的应用程序。在不到 1% 的用户中,会话数据在重定向时丢失。
发生这种情况时,用户无法使用其计算机上的任何浏览器登录。但是,他们可以在另一台计算机上登录。它们似乎都在 Windows 操作系统上,但版本不同。
它是一个独立的应用程序,但现在它通过另一个网站为一部分用户启动(在新窗口中)。只有那些用户有这个问题。
我无法重现该问题,并猜测它与用户的计算机有关。是否有任何类型的防病毒软件或任何与会话数据混淆的东西?
我的会话配置是:
'native' => array(
'name' => 'myappname',
'encrypted' => TRUE,
'lifetime' => 1209600,
),
我添加了很多调试日志记录,并且丢失了会话数据的用户在这里:
2013-02-04 20:09:16 --- DEBUG: EC ******* start login - IP = 67.255.224.46
2013-02-04 20:09:16 --- DEBUG: EC cgl/user - logged in = 1 - IP = 67.255.224.46
2013-02-04 20:09:16 --- DEBUG: EC cgl/user ------- before redirect - user = 5 - logged in = 1 - redirect = bookshelf - $_SESSION = id = 431a0b849f91a37d29b58a23bf130fe9 [ auth_user=>12874 ] - IP = 67.255.224.46
2013-02-04 20:09:16 --- DEBUG: bookshelf/before ~~~~~ NO USER = 0 - logged in = 0 - $_SESSION = id = d502f35a37c7af525c1bda5476c9daac [ ] - IP = 67.255.224.46
2013-02-04 20:09:17 --- ERROR: You must log in to see this page. $_SESSION = id = 66bf60812be3f6b5e3c1df42916e7f18 [ ], IP = 67.255.224.46
“重定向之前”直接在我Request::instance()->redirect('bookshelf');
的“书架/之前”之前在我的控制器的之前方法中。
未丢失会话数据的用户的日志如下所示:
2013-02-04 14:17:53 --- DEBUG: EC ******* start login - IP = 98.89.106.34
2013-02-04 14:17:53 --- DEBUG: EC cgl/user - logged in = 1 - IP = 98.89.106.34
2013-02-04 14:17:53 --- DEBUG: EC cgl/user ------- before redirect - user = 5 - logged in = 1 - redirect = bookshelf - $_SESSION = id = 227e70d49c796ce03dc9f52d8a7b571e [ auth_user=>13246 ] - IP = 98.89.106.34
2013-02-04 14:17:53 --- DEBUG: EC bookshelf/before - logged in = 1 - $_SESSION = id = 227e70d49c796ce03dc9f52d8a7b571e [ auth_user=>13246 last_active=>1360005473 ] - IP = 98.89.106.34
2013-02-04 14:17:53 --- DEBUG: EC bookshelf/index - logged in = 1 - $_SESSION = id = 227e70d49c796ce03dc9f52d8a7b571e [ auth_user=>13246 last_active=>1360005473 school_id=> ] - IP = 98.89.106.34