开发者

PHP custom session mechanism - and cookie expire problem

I'm using session_set_save_handler() to keep my session in Redis, and everything works perfectly, except one thing. after hours and hours of pulling my hair I thought I should开发者_开发技巧 just ask someone. so, on the server side, I set the session life for X minutes. on each page refresh, the session life is set to X minutes, but on the browser the cookie expires after exactly 30 minutes after the first page load. how can I force the cookie life to be extended on each page refresh like on the server side. any thoughts?


Try something like:

session_start();
setcookie(session_name(), session_id(), strtotime('NOW+30MINUTES'));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜