note 53747 added to function.session-set-save-handler
| From: | korvus at kgstudios dot net | Date: | Sat, 11 Jun 2005 12:34:01 +0000 |
| Subject: | note 53747 added to function.session-set-save-handler | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-90264@lists.php.net to get a copy of this message | ||
It seems when you call 'session_name()', php loads the session id automatically from GET (
if the index exists ) and passes it to the 'read' callback method correctly, but the
'write' callback is invoked twice: first the auto-generated session id, then the custom
session id
So be aware of what queries you execute inside the callback .. I got crazy because I used a MySQL
'REPLACE' statement to agilize, and I spent a lot of hours trying to understand why 2 rows
instead of 1 were being affected ( the first id was inserting, the second updating )
I hope this helps!
----
Manual Page -- http://www.php.net/manual/en/function.session-set-save-handler.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+53747
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+53747&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+53747&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+53747&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+53747&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+53747&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+53747&report=yes
Search -- http://master.php.net/manage/user-notes.php