|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-01-02 08:37 UTC] bs_php at infeer dot com
Befor going into the bug-report an importent question:
session.gc_maxlifetime documented as a lifetime messured in *seconds* with default = 1440
1440s = 24min. hmm.... 24min ??
Expectiong the gc_maxlifetime to be rather long 24 min. seams a short time AND 24 relates more to 24h! So is it realy *seconds* ?!
---
The Bug:
As reported in Bug ID #3793 (from kori_mail@hotmail.com) following still happens (taken from sniper@php.net, 2000-12-07 and veryfied by mfischer@php.net, 2001-11-25):
1) "session.gc_maxlifetime" does not work - I set this to 60 sec, but I can read values from the session even when time expired. (I start the session and then I wait
more than 60 sec before calling other script)
2) When I set "session.gc_probability = 100" in php.ini, ALL other session files are deleted (only one session can be used at the time - if 2 clients are connected to
server, the second client deletes session of the first client, etc.). .
My Comment:
To (1): This may be intended when using cookies! Because if session.cookie_lifetime is =0 (until browser is restarted) finding a valid SID in the cookie may prevent the gc from destroying the session data. (The doc leves this open).
To (2): For testing I've set "session.gc_probability = 50" but the effect is the same. As soon as the gc runs, all other session-files are deleted. gc_maxlifetime has no influance.
jmoore@php.net wrote that it may have to do with 'atime' and I would think so too. I would consider to use 'mtime' (maybe as fallback). Even the PHP-manual makes restriktions to 'atime': "Some Unix filesystems can be mounted with atime updates disabled to increase the performance."
[Session]
session.gc_probability = 100
session.gc_maxlifetime = 60
session.save_handler = files
session.save_path = c:\tmp\
session.use_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.serialize_handler = php
session.referer_check =
session.entropy_length = 0
session.entropy_file =
;session.entropy_length = 16
;session.entropy_file = /dev/urandom
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 1
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 22:00:01 2025 UTC |
Hi, I tested PHP 4.1.0 (release) on Windows XP Professional and there is my report: WWW server: IIS 5.1 Filesystem: NTSF (Compressed) PHP.INI: [Session] session.save_handler = files ; handler used to store/retrieve data session.save_path = C:/Windows/Temp ; argument passed to save_handler ; in the case of files, this is the ; path where data files are stored session.use_cookies = 0 ; whether to use cookies session.name = PHPSESSID ; name of the session ; is used as cookie name session.auto_start = 0 ; initialize session on request startup session.cookie_lifetime = 0 ; lifetime in seconds of cookie ; or if 0, until browser is restarted session.cookie_path = / ; the path the cookie is valid for session.cookie_domain = ; the domain the cookie is valid for session.serialize_handler = php ; handler used to serialize data ; php is the standard serializer of PHP session.gc_probability = 100 ; percentual probability that the ; 'garbage collection' process is started ; on every session initialization session.gc_maxlifetime = 600 ; after this number of seconds, stored ; data will be seen as 'garbage' and ; cleaned up by the gc process session.referer_check = ; check HTTP Referer to invalidate ; externally stored URLs containing ids session.entropy_length = 0 ; how many bytes to read from the file session.entropy_file = ; specified here to create the session id ; session.entropy_length = 16 ; session.entropy_file = /dev/urandom session.cache_limiter = nocache ; set to {nocache,private,public} to ; determine HTTP caching aspects session.cache_expire = 180 ; document expires after n minutes session.use_trans_sid = 0 ; use transient sid support if enabled ; by compiling with --enable-trans-sid url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry" ------------------------------------ 1) The ISAPI module doesn't work right (there is some data output error) with ISS 5.1. CGI version works fine. 2) There is still the same problem with "session.gc_maxlifetime". 3) "session.gc_probability = 100" - there is one change. It deleted all files except last accessed session file in previous versions of PHP, now It do nothing (NO files, including expired files are deleted). 4) Session_destroy() function works fine. I will test CGI & ISAPI modules with W2K professional (Apache, IIS 5.0) on FAT32 filesystem tomorrow. -- KoriOS: W2K Professional (SP2) WWW: Apache, IIS 5.0 Filesystem: FAT32 1) ISAPI module works fine with IIS 5.0. Is some bug in IIS 5.1? 2) There are same problems as I reported before with "session.gc_maxlifetime". 3) "session.gc_probability = 100" on FAT32 deletes other session files except last accessed/created session file as before. -- Kori