简体   繁体   中英

PHP Session variable timeout

My application uses some session variables that are timing out even though I thought they would not because I've got the following setting in php.ini:

session.cookie_lifetime = 0

The other session settings in php.ini are pretty much set as their defaults. How do I make sure the session variables stay around until the browser window closes?

我认为您使用设置了会话超时,默认为1440秒-24分钟

Note that since PHP 4.2.3 the life time is calculated on the base of the modification date and not the access date (see session.gc_maxlifetime ). So you have to update the session data on every request to “reset the timer”.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM