本文介绍了通过.htaccess在PHP中扩展会话超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想延长用户在不活动一段时间后仍保持登录状态而不会自动注销的时间.我正在使用PHP会话跟踪登录状态.
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.
我该如何设置呢?我正在尝试从我的.htaccess文件中对其进行控制.
How can I set this, I'm trying to control this from my .htaccess file.
推荐答案
您可以在php.ini
文件中更改此行.
You can change this line in your php.ini
file.
session.gc_maxlifetime = 1440
更新:这似乎有可能,所以我可以纠正
Update: it seems to be possible, so i stand corrected
php_value session.gc_maxlifetime 3600
我还没有尝试过.
这篇关于通过.htaccess在PHP中扩展会话超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!