Home  >  Article  >  Backend Development  >  What is the life cycle of session_PHP Tutorial

What is the life cycle of session_PHP Tutorial

WBOY
WBOYOriginal
2016-07-20 11:05:04892browse


How long is the life cycle of a session?
1 When the browser ends, its life cycle also ends, but the file still exists in /tmp/(sess_???)
2 The next time you reopen the browser The session ID will be reassigned. If you use session_id() to bring back the previous ID, it will read the sess_??? that remains in /tmp and retrieve all the parameters you have set before.
3 You can Modify the remaining time of the session file in php.ini
session.gc_maxlifetime = 1440; after this number of seconds, stored
; data will be seen as 'garbage' and
; cleaned up by the gc process
Default is 1440 seconds, 24 minutes

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/445156.htmlTechArticleWhat is the life cycle of a session? 1 When the browser ends, its life cycle also ends, but the file still exists in /tmp/(sess_???) 2 sessi will be redistributed the next time you reopen the browser...
Statement:
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