Home > Article > Backend Development > How to set session expiration time in php
The method for php to set the session expiration time is: 1. Open the php.ini configuration file; 2. Find the session.gc_maxlifetime configuration and modify the validity time as needed; 3. Restart the php service.
Specific method:
(Video learning recommendation: java course)
Open PHP configuration In the directory where the file is located, find the configuration file
Open the PHP configuration file and search for: maxlifetime and find session.gc_maxlifetime=1440. This configuration is the default validity time of the session
Modify the session.gc_maxlifetime configuration as needed, and then restart the php service.
Related recommendations: php training
The above is the detailed content of How to set session expiration time in php. For more information, please follow other related articles on the PHP Chinese website!