PHP: Infinite session

自古美人都是妖i 提交于 2019-12-10 11:58:27

问题


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. I know I have to restart server to completely change settings.


回答1:


From the documentation....

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().



来源:https://stackoverflow.com/questions/18682735/php-infinite-session

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!