From: "Binay" <[EMAIL PROTECTED]>

> How can I configure the session to get destroyed,
> if not being used from past 10 mins.

If you're using the default session handler, the session files are cleaned
up after not being used for 1440 seconds (by default), and the session is
basically destroyed. You can adjust the session.gc_maxlifetime setting in
php.ini to adjust the time.

This time isn't exact, though. The cleanup process is based upon a
probability that is 1% by default. That means the process has a 1% chance of
being started when there is a request to your site. So the files may be
older than 1440 seconds and just waiting for the garbage collection process
to be initiated.

If you need it to be exactly 10 minutes of inactivity, the best method is to
just store the time of the last request as a session variable and do the
checking yourself upon each request. If the last request was more than 10
minutes ago, then handle it accordingly.

---John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to