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.
精彩评论