最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
session的几个问题
时间:2022-06-30 11:50:10 编辑:袖梨 来源:一聚教程网
session 的生命周期是多长
1 浏览器结束时其生命周期也同时结束,但是档案仍然存在于 /tmp/(sess_???)
2 下次重新开浏览器时会重新分配 sessionID,如果你使用 session_id() 把以前的 ID 带回来,则会去读取残存在 /tmp 处的 sess_???, 取回你之前所有已经设定的参数
3 可以在 php.ini 里修改 session 档案残存的时间
session.gc_maxlifetime = 1440 ; after this number of seconds, stored
; data will be seen as 'garbage' and
; cleaned up by the gc process
默认是 1440 秒,24分钟
使用 session 注意的存储路径问题
看看 php.ini 里对于 session 的设置
[Session]
session.save_handler = files ; handler used to store/retrieve data
session.save_path = /tmp ; argument passed to save_handler
; in the case of files, this is the
; path where data files are stored
默认是存于 /tmp 目录下,这个目录可不一定真有啊!!! 最好改为你的 php 安装路径,比如 c:/php
1 浏览器结束时其生命周期也同时结束,但是档案仍然存在于 /tmp/(sess_???)
2 下次重新开浏览器时会重新分配 sessionID,如果你使用 session_id() 把以前的 ID 带回来,则会去读取残存在 /tmp 处的 sess_???, 取回你之前所有已经设定的参数
3 可以在 php.ini 里修改 session 档案残存的时间
session.gc_maxlifetime = 1440 ; after this number of seconds, stored
; data will be seen as 'garbage' and
; cleaned up by the gc process
默认是 1440 秒,24分钟
使用 session 注意的存储路径问题
看看 php.ini 里对于 session 的设置
[Session]
session.save_handler = files ; handler used to store/retrieve data
session.save_path = /tmp ; argument passed to save_handler
; in the case of files, this is the
; path where data files are stored
默认是存于 /tmp 目录下,这个目录可不一定真有啊!!! 最好改为你的 php 安装路径,比如 c:/php
相关文章
- 洛克王国智慧树精灵果实点位大全 04-21
- 亿万光年联合要塞选择推荐指南 04-21
- 七大罪起源套装系统介绍说明 04-21
- 红色沙漠暗影手套怎么获得 04-21
- 辽宁高速通app如何查ETC余额 04-21
- 《Pragmata》销量更新 04-21