Session expiration time setting in php_PHP tutorial

WBOY
Release: 2016-07-13 17:50:23
Original
972 people have browsed it

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

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478261.htmlTechArticleWhen we use session to save the user’s login information, if the user does not choose to click the logout button but chooses If you close the browser directly, will the session saved on the server last long...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!