保持登录状态记住我 - PHP会话和cookie [英] stay logged in & remember me - PHP sessions and cookies

查看:189
本文介绍了保持登录状态记住我 - PHP会话和cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

寻找有关如何完成以下操作的指导。


默认登录:

用户登录时的会话有效期为25分钟,或者直到浏览器关闭:

Looking for guidance on how to accomplish the following.

Default login:
User is logged in with a session lifetime of 25 minutes, or until the browser closes:

展开 | 选择 < span class =codeDivider> | Wrap | 行号

推荐答案

**新想法**

我应该只在25分钟到30天之间调整session_set_cookie_params()的
** new thoughts **

should I only adjust the


cookie_timeout值,如果用户设置了记住我的偏好。并且仅针对保持登录首选项的
cookie_timeout value for session_set_cookie_params() from 25min to 30 days if the user sets the ''remember me'' preference. And use the setcookie() expire time only for a


login_status变量使用setcookie()过期时间?因此,
login_status variable in regards to the ''stay logged in'' preference? Therefore, the


这篇关于保持登录状态记住我 - PHP会话和cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆