Bug #74548 [NEW]: Session name and session id binding

From: Date: Sat, 06 May 2017 09:46:38 +0000
Subject: Bug #74548 [NEW]: Session name and session id binding
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-208965@lists.php.net to get a copy of this message
From: gollumben at gmx dot de Operating system: Debian GNU/Linux 8 (jessie) PHP version: 7.0.18 Package: Session related Bug Type: Bug Bug description:Session name and session id binding Description: ------------ When starting a session with a certain name, closing it and starting a session with a different name, the session ID is not changed. I find this misleading. I use cookies for the session ID storage and with this procedure there will be two cookies with different names with the same session ID. In my opinion, PHP should create a new session ID for a new session with a different name. This also makes makes sense from a different point of view: When starting a session with a different name, PHP will want to look for the cookie with the other name. Admitting, the practice of using multiple sessions within one script is not be the best. Test script: --------------- session_name("session1"); session_start(); echo session_name() ." ". session_id() ."<br>"; session_write_close(); session_name("session2"); session_start(); echo session_name() ." ". session_id(); //the ID will be the same as before Expected result: ---------------- The second session ID should be different from the first one. Actual result: -------------- The second session ID and the first are the same. -- Edit bug report at https://bugs.php.net/bug.php?id=74548&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74548&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74548&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74548&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=74548&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=74548&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=74548&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=74548&r=needscript Try newer version: https://bugs.php.net/fix.php?id=74548&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=74548&r=support Expected behavior: https://bugs.php.net/fix.php?id=74548&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=74548&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=74548&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=74548&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74548&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=74548&r=dst IIS Stability: https://bugs.php.net/fix.php?id=74548&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=74548&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=74548&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=74548&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=74548&r=mysqlcfg

« previous php.bugs (#208965) next »