通过 .htaccess 延长 PHP 中的会话超时
我想延长用户在我的网站上保持登录状态的时间,而不会在一段时间不活动后自动注销。 我正在使用 PHP 会话跟踪登录状态。
我该如何设置它,我正在尝试从我的 .htaccess 文件中控制它。
I want to up the time my users will stay logged into my site without getting automatically logged out after a period of inactivity. I'm tracking the logged in status using PHP sessions.
How can I set this, I'm trying to control this from my .htaccess file.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您无法从 htaccess 文件执行此操作,但您可以在php.ini
文件中更改此行。更新:这似乎是可能的,所以我纠正了
我还没有尝试过这个。
You can't do that from the htaccess file butYou can change this line in yourphp.ini
file.Update: it seems to be possible, so i stand corrected
I haven't tried this out though.
您还可以尝试使用 < 在运行时更改该值代码>ini_set:
You could also try changing the value at runtime using
ini_set
: