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

How to set session expiration time in php

王林
Release: 2023-03-07 12:08:01
Original
3099 people have browsed it

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!

Related labels:
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