Bug #70013 [Opn]: Reference to $_SESSION is lost after a call to session_regenerate_id()

From: Date: Sat, 11 Jul 2015 06:38:02 +0000
Subject: Bug #70013 [Opn]: Reference to $_SESSION is lost after a call to session_regenerate_id()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-194322@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70013&edit=1 ID: 70013 Updated by: mike@php.net Reported by: jakub at zalas dot pl Summary: Reference to $_SESSION is lost after a call to session_regenerate_id() Status: Open Type: Bug Package: Session related Operating System: Debian PHP Version: 7.0Git-2015-07-07 (Git) Block user comment: N Private report: N New Comment: It may seem more reasonable from an implementors point of view, because you're looking at the C codes, but definitely does not seem reasonable for an appointment developer. This breaks userland in an very unintuitive way. Previous Comments: ------------------------------------------------------------------------ [2015-07-10 14:53:19] laruence@php.net I'd like mark this as won't fix.. the new behaviors seems more reasonable ------------------------------------------------------------------------ [2015-07-10 09:06:02] mike@php.net +1, "deleting the session", if ever should mean on the backend under the old key; the data will stay the same and a reference to it should be kept intact. ------------------------------------------------------------------------ [2015-07-09 09:16:17] tyrael@php.net Bob: first of all, deleting the old session won't happen by default, so your definition is a bit misleading, and also, from the "new" session will hold the same data only under a different session id, so I think not many people would expect that the $_SESSION superglobal will be recreated hence losing the reference. if you add this to the fact that this is an undocumented behavior change I think we should consider this a bug and fix it. ------------------------------------------------------------------------ [2015-07-08 15:10:45] bwoebi@php.net It is a BC break, but I'm not sure if the behavior before was correct. References should normally be broken up before deletion… And session_regenerate_id() is exactly that: delete old session, create new session. ------------------------------------------------------------------------ [2015-07-08 07:06:52] stloyd at o2 dot pl This is BC break that can be easily reproduced: http://3v4l.org/PRhdj ------------------------------------------------------------------------ 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=70013 -- Edit this bug report at https://bugs.php.net/bug.php?id=70013&edit=1

« previous php.bugs (#194322) next »