note 86791 added to function.session-write-close
| From: | noel at osu1 dot php dot net | Date: | Tue, 04 Nov 2008 05:29:53 +0000 |
| Subject: | note 86791 added to function.session-write-close | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-146104@lists.php.net to get a copy of this message | ||
I was having the same problem as many here regarding setting session data just before a header
location redirect and having the session data just not be there. I tried everything people here
said, and none of their combinations worked. What did finally work for me was to fire off a
session_regenerate_id(true) call just prior to the header() and die() calls.
session_regenerate_id(true);
header('location: blah blah');
die();
Without the regenerate id call, the write close did not seem to do anything. session_write_close()
doesn't seem to matter at all. It certainly didn't fix anything on its own for me.
This is a rather annoying issue with php sessions that I've never run into before. I store my
sessions to /dev/shm (which is RAM) so file IO blocking can't be the problem. Now I'm
nervous that some other session data might not be getting updated prior to a header() location
change, which is extremely important and common in any web app.
----
Server IP: 208.69.120.35
Probable Submitter: 24.165.51.190
----
Manual Page -- http://www.php.net/manual/en/function.session-write-close.php
Edit -- https://master.php.net/note/edit/86791
Del: integrated -- https://master.php.net/note/delete/86791/integrated
Del: useless -- https://master.php.net/note/delete/86791/useless
Del: bad code -- https://master.php.net/note/delete/86791/bad+code
Del: spam -- https://master.php.net/note/delete/86791/spam
Del: non-english -- https://master.php.net/note/delete/86791/non-english
Del: in docs -- https://master.php.net/note/delete/86791/in+docs
Del: other reasons-- https://master.php.net/note/delete/86791
Reject -- https://master.php.net/note/reject/86791
Search -- https://master.php.net/manage/user-notes.php