Home >Backend Development >PHP Problem >How to set session expiration time in php

How to set session expiration time in php

王林
王林Original
2020-11-06 09:37:403123browse

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.

How to set session expiration time in php

Specific method:

(Video learning recommendation: java course)

Open PHP configuration In the directory where the file is located, find the configuration file

How to set session expiration time in php

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

How to set session expiration time in php

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!

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