Catalin Trifu wrote:
Hi,No it will not inform you and there is no way it can inform you because the gc does not know how to inform you, this is logical.
It does not.
session.gc_maxlifetime states that PHP will consider
that garbage, but it will not inform you it did so,
neither does
it terminate the session.I consider deleting of the session file to be termination of the session.
Make an experimet if you want. set the "timeout" 5 minutes, go for a coffee and come back in 10 minutes. You'll have a surprise <snip> ; After this number of seconds, stored data will be seen as 'garbage' and ; cleaned up by the garbage collection process. session.gc_maxlifetime </snip> But since the garbage collection does not run on every request... So, the gc_maxlife states only that the data is passible for garbage, collection (much like java) nothing more. As for the cookie_lifetime, doesn't work either.
I was just trying to answer the original question:
"Is there a default for when the $_SESSION array times out i.e., it's no longer available for the code?"
Yes,
session.gc_maxlifetime - if the gc starts up and the session file is older then this value, the file is removed, no $_SESSION array anymore.
cookie_lifetime - if session cookie is not sent (eg. it expired in the browser), session_start() starts up a new session with empty $_SESSION (even if the original session file is available).
Cheers, Catalin
"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
Let me corect you.
Catalin Trifu wrote:
Hi,
No, there is not! You have to manage yourself the timeout, for instance through a timestamp, which you verify on each request. PHP does not destry sessions by itself.
Yes, it does, check your session.gc_maxlifetime setting (gc stands for garbage colector). You cannot change or set this setting per vhost or directory. If you want, you can manage the session yourself (see session_set_save_handler()) and implement your own expiration routines. Anothor thing that can affect session lifetime is the lifetime of session cookie, default is set by session.cookie_lifetime.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php