Home > Backend Development > PHP Tutorial > php中怎么设置session过期时间

php中怎么设置session过期时间

WBOY
Release: 2016-06-23 14:27:53
Original
993 people have browsed it

php ession php session

php中怎么设置session过期时间,当session过期后,session中的值无效,

我需要在代码中设置session时间,不需要修改配制文件。

回复讨论(解决方案)

session 默认是浏览器关闭就失效的,但是可以用session_destroy() 来销毁所有session,也可以用unset 删除指定的session。

http://www.laruence.com/2012/01/10/2469.html
可以看看这个文章

ini_set('session.gc_maxlifetime', 5);

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