Home > Backend Development > PHP Tutorial > 怎么在PHP中设置session永久有效,除非关闭浏览器

怎么在PHP中设置session永久有效,除非关闭浏览器

WBOY
Release: 2016-06-13 12:04:29
Original
1288 people have browsed it

如何在PHP中设置session永久有效,除非关闭浏览器
项目要求session永久有效,除非关闭浏览器,想直接在代码中设置,不经过php.ini文件,一面部署的时候麻烦!
请教大神赐教!感激不尽!
------解决方案--------------------
你不改默认的设置,默认就是这样的。
------解决方案--------------------
使用cookies
------解决方案--------------------
只要不关闭浏览器,session 就是有效的!

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