感谢@ AD7six:
的问题是在我的php.ini配置:
; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
; http://php.net/session.gc-maxlifetime
session.gc_maxlifetime = 1440
这里的时间以秒计,不分钟,所以,要配置相匹配
Configure::write('Session', array(
'defaults' => 'php',
'timeout' => 1440 // 24 hours
));
我需要:
; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
; http://php.net/session.gc-maxlifetime
session.gc_maxlifetime = 86400
; 24 hours: 1440*60
您可以检查您的Cookie使用期限是否正确,但应该确定,但最好重新检查它 – Soulan 2014-08-27 09:35:17
检查session.gc_maxlifetime。如果会话过期,CakePHP不是这样做的,您需要确定原因(一种方法是使会话文件/存储文件夹只读,并在尝试删除它时查找错误消息)。另一个典型的情况是会话正在被攻击/失效(并行404请求触发你的应用程序可能会导致会话ID被更新,使会话cookie的ID与服务器上的ID不同)。或者:它是应用程序/服务器/开发人员特定的。公寓从建议你不可能得到答案。 – AD7six 2014-08-27 10:09:45
@Soulan我的cookie在配置说明后24小时过期。 – 2014-08-27 10:13:23