Re: session ID does not delete itself

From: Date: Fri, 19 Oct 2001 19:47:01 +0000
Subject: Re: session ID does not delete itself
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-71619@lists.php.net to get a copy of this message
in php.ini session.gc_probability = 1 ; percentual probability that the ; 'garbage collection' process is started ; on every session initialization session.gc_maxlifetime = 604800 ; after this number of seconds, stored ; data will be seen as 'garbage' and ; cleaned up by the gc process I have my php.ini set to everytime php is run it looks for session files 7 days (604800 seconds) old, if there are any files at all, there is a 1% chance php will delete them. this is called garbage collection. so to simply answer your question: no. they are not deleted when the user quits their browser. the cookie however can be set to a lifetime of 0, which means when the browser quits the cookie is considered expired and the browser on the next launch will delete the cookie. -- Chris Lee lee@mediawaveonline.com "Peter" <php_guy@visors.com.hk> wrote in message news:Pine.LNX.4.21.0110191940350.8969-100000@ns.visors.com.hk... > > Hi, > > I have been experimenting with PHP4 using sessions and one of my books > says that session ID's are created in the /tmp directory so I take a look > in there and I find are about 10 sessions that have not been deleted dated > earliest to about being week old > > ie. sess_5b30ccebb1d098c37a5e46efd7708fef > > I have been experimenting with user authentication with sessions and just > plain starting a session when a user accesses the site. > > Well, the site is still experimental and each time I logged myself out. > > But I thought sessions were supposed to wipe themselves out from the /tmp > directory immediately after leaving the website. > > Appreciate if someone could shed the light on this issue for me. > > Thanks. > > Peter >

« previous php.general (#71619) next »