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
  [EMAIL PROTECTED]




"Peter" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> 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
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to