Re: Session - when they expirate ?
| From: | Jochem Maas | Date: | Mon, 01 May 2006 21:08:51 +0000 |
| Subject: | Re: Session - when they expirate ? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-235216@lists.php.net to get a copy of this message | ||
Martin Zvarík wrote:
Hi, I was looking all over the internet and I don't understand when and how does the PHP session expirate. I suppose that it happens when the user is inactive. On my website I don't use cookies for session and it has standard php.ini configuration: session.gc_maxlifetime = 1440gc = garbage collector. the ammount of seconds of inactivity for a given session id is allowed, after which the session data is seen as garbage - it will then be removed at the next run of the garbage collector, I have no idea whether a session id that comes in for a session marked as garbage, if the garbage collector has not yet run, is honoured or seen as a new session.
session.gc_divisor = 100 session.gc_probability = 1these two controls how often/likely the garbage will run (running it on every request would be a major performance hit)
session.cache_expire = 180this affects cachable pages that are using the session - after this time the page must be refreshed at the server (i.e. the browser cache is invalidated). basically this has to do with the default cache-related headers that are sent out by php when you are using sessions.
So, does this mean, that if the visitor is 180 minutes inactive it automatically deletes the session ??no see above :-). check out the manual for more info: http://php.net/manual/en/ref.session.php#session.configuration
Thanks, Martin