PHP:无限会话 [英] PHP: Infinite session
问题描述
我在本地安装了WAMP服务器,并正在开发一些小项目.我添加了带有会话的授权页面.
我的本地主机上的所有PHP设置均为默认设置,因此它表示session.gc_maxlifetime = 1440
,等于24分钟.但是问题在于,该会话不会结束.绝不.
我试图将该设置更改为60秒,甚至600秒,但是无论如何它都是无限的.
I have a WAMP server installed locally and developing some small project. I've added an authorization page with sessions.
All the PHP settings on my localhost are default, so it means that session.gc_maxlifetime = 1440
, so it equals to 24 minutes. But the problem is that this session does not end. Never.
I tried to change that setting to 60 seconds, or even 600 seconds, but it is infinite anyway.
能否请您解释一下我,这是问题还是我刚刚忘记更改其他设置?
Can you, please, explain me, is it a problem or I have just forgotten to change some other settings?
P.S.我知道我必须重新启动服务器才能完全更改设置.
P.S. I know I have to restart server to completely change settings.
推荐答案
从文档....
session.cookie_lifetime 指定cookie在其中的生存期 发送到浏览器的秒数.值0表示直到 浏览器已关闭."默认为0.另请参见 session_get_cookie_params()和session_set_cookie_params().
session.cookie_lifetime specifies the lifetime of the cookie in seconds which is sent to the browser. The value 0 means "until the browser is closed." Defaults to 0. See also session_get_cookie_params() and session_set_cookie_params().
这篇关于PHP:无限会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!