php session不自动销毁

z老师
Release: 2020-07-30 10:42:22
Original
1167 people have browsed it

php session不自动销毁

服务器环境:win2003 + IIS + php5.3

php session 配置如下:

Directive Local Value Master Value session.auto_start Off Off session.bug_compat_42 Off Off session.bug_compat_warn Off Off session.cache_expire 180 180 session.cache_limiter nocache nocache session.cookie_domain no value no value session.cookie_httponly Off Off session.cookie_lifetime 0 0 session.cookie_path / / session.cookie_secure Off Off session.entropy_file no value no value session.entropy_length 0 0 session.gc_divisor 100 100 session.gc_maxlifetime 1440 1440 session.gc_probability 1 1 session.hash_bits_per_character 5 5 session.hash_function 0 0 session.name PHPSESSID PHPSESSID session.referer_check no value no value session.save_handler files files session.save_path D:\phptemp D:\phptemp session.serialize_handler php php session.use_cookies On On session.use_only_cookies On On session.use_trans_sid 0 0
Copy after login

现在的问题是用户登录后就能一直在线,临时目录下的session文件不能自动销毁,越积越多,最后把服务器拖垮了。

奇怪的是同样的配置在另外一台服务器上就没问题,应该是系统设置方面的问题,不涉及到程序开发,请有运维经验的高人指点?

回复讨论(解决方案)

关注一下期待高手来回答。

有没有高手啊!

你改变了session.save_path还能垃圾回收吗?

我的经验是session.save_path为操作系统的临时目录时(c:\windows\temp)才能回收

session.save_path目录换到c:\windows\temp果然可以了,应该是新建目录权限设置问题.

我的理解是: GC 实际是操作系统的垃圾处理机制,他只在发现有垃圾(当然是系统的垃圾箱啦)时才询问“垃圾”归属者是否需要清理

相关专题推荐php 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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!