Re: Destroying session if not being used from past 10 mins.
| From: | CPT John W. Holmes | Date: | Tue, 21 Oct 2003 12:49:22 +0000 |
| Subject: | Re: Destroying session if not being used from past 10 mins. | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-166947@lists.php.net to get a copy of this message | ||
From: "Binay" <binay@oliveinternet.com>
> Is it possible to increase the probability which is by default 1% to 99 %
> and make sure that session are destroyed after 10 mins by setting
> session.gc_maxlifetime to 600.
I wouldn't recommend that, but you could. The setting to 600 is fine, but I
wouldn't adjust the probability.
Like I said, if you need a hard and fast 10 minute rule, then keep track of
the time yourself within your session.
$_SESSION['last_access'] = time();
If the session variable doesn't exist or it's been over 10 minutes (600
seconds) since the last access, then make them log in again or whatever.
---John Holmes...