我如何在Codeigniter中设置登录的会话以记住2周?
-
28-09-2019 - |
题
如果用户登录并选择“记住我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);
不隶属于 StackOverflow