note 116217 added to book.session
| From: | bouvrette dot nicolas at gmail dot com | Date: | Sun, 23 Nov 2014 21:43:44 +0000 |
| Subject: | note 116217 added to book.session | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-201011@lists.php.net to get a copy of this message | ||
Be careful if you are updating to PHP 5.6 since the the Sessions's Write behavior changed. It
now only writes the session if you changed the data. So this means that if you rely on your session
to update an activity time stamp on the server (to control session expiry) you will end up having
issues. Here is a quick fix if you are implementing SessionHandlerInterface:
public function close() {
$this->write($this->id, serialize($_SESSION));
return true;
}
Make sure you also use this:
ini_set('session.serialize_handler', 'php_serialize'); // Force standard
PHP functions handler for flexibility
More details here:
Request #17860 (Session write short circuit)
https://bugs.php.net/bug.php?id=17860
----
Server IP: 72.52.91.14
Probable Submitter: 216.246.243.217
----
Manual Page -- http://php.net/manual/en/book.session.php
Edit -- https://master.php.net/note/edit/116217
Del: integrated -- https://master.php.net/note/delete/116217/integrated
Del: useless -- https://master.php.net/note/delete/116217/useless
Del: bad code -- https://master.php.net/note/delete/116217/bad+code
Del: spam -- https://master.php.net/note/delete/116217/spam
Del: non-english -- https://master.php.net/note/delete/116217/non-english
Del: in docs -- https://master.php.net/note/delete/116217/in+docs
Del: other reasons-- https://master.php.net/note/delete/116217
Reject -- https://master.php.net/note/reject/116217
Search -- https://master.php.net/manage/user-notes.php