note 13214 deleted from ref.session by nlopess
| From: | nlopess@php.net | Date: | Fri, 12 Mar 2004 14:44:32 +0000 |
| Subject: | note 13214 deleted from ref.session by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-66732@lists.php.net to get a copy of this message | ||
Note Submitter: j.mccoy@cc.utexas.edu
----
If your using PHP session handling with PostgreSQL as session storage, a efficient method of
handling garbage collection would be a rule:
create rule rle_sessions_gc as on insert into sessions where (random() >= 0.7) do delete from
sessions where expiry <= current_timestamp;
this rule assumes that the sessions table has an expiry field into which is placed the timestamp at
which the session should expire; change the value random is checked against to change the
probability of garbage collection.