Home  >  Article  >  Backend Development  >  How to set session validity period in php

How to set session validity period in php

王林
王林Original
2020-08-28 14:13:004655browse

php method to set the session validity period: first enter the php installation directory, find and open the php.ini configuration file; then find the configuration session.gc_maxlifetime, modify the validity time as needed; finally restart the php service.

How to set session validity period in php

Specific method:

(Video tutorial recommendation: php video tutorial)

Enter first In the directory where the PHP configuration file is located, find the configuration file and open it;

How to set session validity period in php

#Then find the configuration session.gc_maxlifetime=1440. This configuration is the default validity time of the session. Adjust it as needed. Just change it.

(Related recommendations: php training)

How to set session validity period in php

Just restart php after the modification is completed.

The above is the detailed content of How to set session validity period in php. For more information, please follow other related articles on the PHP Chinese website!

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