note 102688 deleted from function.unserialize by googleguy
| From: | googleguy@php.net | Date: | Sat, 12 Jan 2013 11:02:22 +0000 |
| Subject: | note 102688 deleted from function.unserialize by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-192980@lists.php.net to get a copy of this message | ||
Note Submitter: frank at interactinet dot com
----
When using a custom session handler to store sessions in a database, loss of session data is
probably not from unserializing data.
It is common to use regenerate_session_id() when a user logs in to prevent session fixation.
It turns out regenerate_session_id() does not automatically update the database. You need to do this
manually:
<?php
$old = session_id();
regenerate_session_id();
$new = session_id
$sql = "update session_table set session_id = '$new' where session_id =
'$old'";
?>
Hope this saves you some time.