Bug #61470 [Com]: session_regenerate_id() do not create session file
| From: | webmaster at tubo-world dot de | Date: | Sun, 26 Oct 2014 23:41:46 +0000 |
| Subject: | Bug #61470 [Com]: session_regenerate_id() do not create session file | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-188313@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=61470&edit=1
ID: 61470
Comment by: webmaster at tubo-world dot de
Reported by: david at grudl dot com
Summary: session_regenerate_id() do not create session file
Status: Assigned
Type: Bug
Package: Session related
Operating System: ANY
PHP Version: 5.4.0
Assigned To: yohgaki
Block user comment: N
Private report: N
New Comment:
There is no point in having session_regenerate_id create a file and lock.
It makes no sense at all since a parallel session_regenerate_id would create a different random ID
anyway.
All you have to make sure is, that you call session_write_close immediatly AFTER
session_regenerate_id as I also explained in #49462
This way, the data will be available on the next request. See also https://github.com/symfony/symfony/issues/7885
So I think the issue can be closed.
Previous Comments:
------------------------------------------------------------------------
[2014-09-08 13:12:30] craig at craigfrancis dot co dot uk
Related To: Bug #67736
------------------------------------------------------------------------
[2012-05-24 21:19:11] chris at netshake dot de
This Workaround works well for me.
// Session is already started
session_regenerate_id( true ); // delete old session
session_write_close(); // i'm not sure about that but it's required.
session_start(); // reinitialize session with newly created id from
'session_regenerate_id()'
I hope that future PHP-Versions will not make problems with this.
Greets Chris
------------------------------------------------------------------------
[2012-03-28 08:02:46] yohgaki@php.net
I have to deal with session ID collision detection in session_regenerate_id() for
strict session.
I think I found what's wrong. Assigned to myself.
------------------------------------------------------------------------
[2012-03-27 16:23:37] david at grudl dot com
Usage of echo does not matter.
------------------------------------------------------------------------
[2012-03-25 21:00:29] riptide dot tempora at opinehub dot com
How much of the bug is caused by having an echo before session_regenerate_id() which tries to send a
new cookie to the end-user?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=61470
--
Edit this bug report at https://bugs.php.net/bug.php?id=61470&edit=1