After we use the session to save the user's login information, if the user does not choose to click the logout button but chooses to close the browser directly, will the session saved on the server side exist for a long time?
The answer is no! Because SESSION has an expiration time. If the time between the last modification of the session and the current one exceeds a certain value, the session will be cleared!
There is such an option in the php configuration file php.ini:
; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
session.gc_maxlifetime = 1440 www.2cto.com
That is to say, if you do not visit the website for more than 24 minutes, the server will destroy your SESSION, and you will be logged out at this time!
All Rights Reserved by Zero Space