note 99680 added to function.session-set-save-handler
| From: | Ihsan at osu1 dot php dot net | Date: | Mon, 30 Aug 2010 19:30:36 +0000 |
| Subject: | note 99680 added to function.session-set-save-handler | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-172169@lists.php.net to get a copy of this message | ||
to newton at tricko dot com dot br
Php session system has many troubles. Ok. But your solution lacks garbage collection.
Garbage collection is required
1) If a client leaves the session without logging off. I.e. simply closing the browser.
2) If a client times out... Does not initiate any communication with the server longer than the
expiry time.
Garbage collection avoids inflation of session table and it is an additional security measure too.
To initiate garbage collection you may:
1) Add a probabilistic trigger. Like comparing a random number in the range of 0...999 with 543 and
when they are equal, doing it.
2) Write a jobs manager, scheduling garbage collection to specific time intervals etc...
----
Server IP: 160.75.100.7
Probable Submitter: 85.107.101.142
----
Manual Page -- http://www.php.net/manual/en/function.session-set-save-handler.php
Edit -- https://master.php.net/note/edit/99680
Del: integrated -- https://master.php.net/note/delete/99680/integrated
Del: useless -- https://master.php.net/note/delete/99680/useless
Del: bad code -- https://master.php.net/note/delete/99680/bad+code
Del: spam -- https://master.php.net/note/delete/99680/spam
Del: non-english -- https://master.php.net/note/delete/99680/non-english
Del: in docs -- https://master.php.net/note/delete/99680/in+docs
Del: other reasons-- https://master.php.net/note/delete/99680
Reject -- https://master.php.net/note/reject/99680
Search -- https://master.php.net/manage/user-notes.php