0

I'm a bit confused with this,

Say the session has been started with default php ini settings where gc_maxlifetime is 1440 seconds. And i supposed to use remember me functionality with this, to which i set cookie lifetime as 14 days. As long as the session max life time set to 24 minutes which is obviously lesser than cookie life time (14 days), after 10 days (for example) the session likely (of course depends on gc probability) to be expired and would have no reference to the session id the remember me cookie has.

So how would setting a remember me cookie lifetime longer than the session lifetime remember/resume the session? or do i need to change the session max lifetime according to the cookie lifetime?

4

2 回答 2

1

通常,“记住我”cookie 是持久性 cookie,而不是会话 cookie。它包含一些允许自动登录操作的加密信息。即当没有活动会话时,但“记住我”cookie 存在时,将启动一个新会话。

于 2013-05-02T16:07:13.990 回答
0

session GC 功能将删除 session 数据(默认保存在纯文本文件中),而 cookie 设置将删除保留 session id 的 cookie。

为了使会话处于活动状态,其数据文件和具有其 ID 的 cookie 必须存在 (AFAIK)。

于 2013-05-02T18:57:56.670 回答