开发者

How long will a session variable last if you don't unset it?

开发者 https://www.devze.com 2023-04-09 17:11 出处:网络
When I store a variable in a session (in php), how long will that variable linger in that file? Will it be there until someone unsets the variable or deletes the file?

When I store a variable in a session (in php), how long will that variable linger in that file? Will it be there until someone unsets the variable or deletes the file?

update: so it is session.gc-maxlifetime setting that is set in php.ini file. You can check your setting by calling phpinfo(). Mine is set to 1440 seconds so 24 minutes. Might have found a duplicate here, although when googli开发者_开发技巧ng I didn't find it at first because of the wording.


By default it will be there 24 minutes. (Which is the default php.ini file setting).

As you commented, this is the setting: http://www.php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime


Look in your php.ini file. It will tell you exactly how long the default session will last.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号