我觉得应该是超时的原因吧!
; Lifetime in seconds of cookie or, if 0, until browser is restarted.
session.cookie_lifetime = 0; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
; WARNING: Your filesystem must store access times. Windows FAT does
; not. So, see session_set_save_handler() and write your own
; session handler with a different mechanism for cleaning up sessions.
session.gc_maxlifetime = 14400 ;等于三个小时。; NOTE: If you are using the subdirectory option for storing session files
; (see session.save_path above), then garbage collection does *not*
; happen automatically. You will need to do your own garbage
; collection through a shell script, cron entry, or some other method.
; For example, the following script would is the equivalent of
; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes):
; cd /path/to/sessions; find -cmin +24 | xargs rm
; Lifetime in seconds of cookie or, if 0, until browser is restarted.
session.cookie_lifetime = 0; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
; WARNING: Your filesystem must store access times. Windows FAT does
; not. So, see session_set_save_handler() and write your own
; session handler with a different mechanism for cleaning up sessions.
session.gc_maxlifetime = 14400 ;等于三个小时。; NOTE: If you are using the subdirectory option for storing session files
; (see session.save_path above), then garbage collection does *not*
; happen automatically. You will need to do your own garbage
; collection through a shell script, cron entry, or some other method.
; For example, the following script would is the equivalent of
; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes):
; cd /path/to/sessions; find -cmin +24 | xargs rm
-----------test.php---------
<?
session_start();
session_register("theTempVar");
$theTempVar = "This is a test";
echo $theTempVar;
?>
你多开几个窗口,打开 %dir%/test.php
你再看看存放session临时文件的目录下,是否有多个sess_xxxxxxxx文件;
无论你是否关闭部分浏览器,你看一下,它们什么时候会消失……试后请告诉结果!
我目前还没有办法进一步去测试,因为session不正常多数是发生在,有几个用户登入操作我的session时就会不正常,现在晚上没有人登入我的机器。