如果用户登录并选择“记住我2周”,我希望会话记住他们2周。如果没有,它应该在2小时内到期。我该怎么做呢?

有帮助吗?

解决方案

//if variable two_weeks is set, set session expiration to 2 weeks; otherwise 2 hours  
($two_weeks)?$t='1209600':$t='7200');
$this->session->set_userdata('sess_expiration',$t);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top