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

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

WBOY
WBOYOriginal
2016-06-13 12:04:291215browse

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

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