Bug #76358 [NEW]: Cannot change session name when session is active
From: tony at marston-home dot demon dot co dot uk
Operating system: Windows 10
PHP version: 7.2.5
Package: Session related
Bug Type: Bug
Bug description:Cannot change session name when session is active
Description:
------------
This error was introduced in 7.2 for no good reason. I have been using
this technique since 2003 to enable a user to have multiple sessions on
the same PC, each with its own name and ID. This now fails.
I know that https://bugs.php.net/bug.php?id=75650 has declared
that this
not a bug, but I strongly disagree.
Why was this change made? What was the reasoning? If this usage does not
cause a problem in the engine then why is it now being disallowed? If
this is someone's idea of "purity" then that someone needs a good
talking to as this is overstepping the mark.
Test script:
---------------
session_start();
$old_name = session_name('NEWSESSION'); // with 7.2 this now returns
FALSE
session_regenerate_id();
⦠do something
session_name($old_name); // with 7.2 this now fails as $old_name is
FALSE
Expected result:
----------------
I expect session_name() to do what it has been doing for the past 15
years, that is to return the existing session name while assigning a new
one. The documentation clearly states "Get and/or set the current
session name", and the "and/or" indicates that it should be able to do
both at the same time.
Actual result:
--------------
session_name() returns FALSE instead of the current session name.
--
Edit bug report at https://bugs.php.net/bug.php?id=76358&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76358&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76358&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76358&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=76358&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=76358&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=76358&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=76358&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=76358&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=76358&r=support
Expected behavior: https://bugs.php.net/fix.php?id=76358&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=76358&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=76358&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=76358&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76358&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=76358&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=76358&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=76358&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76358&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=76358&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=76358&r=mysqlcfg
Thread (15 messages)
- tony at marston-home dot demon dot co dot uk
- peehaa@php.netBug #76358 [Opn->Nab]: Cannot change session name when session is active
- tony at marston-home dot demon dot co dot ukBug #76358 [Nab]: Cannot change session name when session is active
- a at b dot c dot deBug #76358 [Com]: Cannot change session name when session is active
- tony at marston-home dot demon dot co dot ukBug #76358 [Nab]: Cannot change session name when session is active
- tony at marston-home dot demon dot co dot ukDoc->Bug #76358 [Opn]: Cannot change session name when session is active
- a at b dot c dot deBug #76358 [Com]: Cannot change session name when session is active
- tony at marston-home dot demon dot co dot ukBug #76358 [Opn]: Cannot change session name when session is active
- tony at marston-home dot demon dot co dot ukBug #76358 [Opn]: Cannot change session name when session is active
- cmb@php.netBug #76358 [Opn->Asn]: Cannot change session name when session is active
- tony at marston-home dot demon dot co dot ukBug #76358 [Asn]: Cannot change session name when session is active
- tony at marston-home dot demon dot co dot ukBug #76358 [Com]: Cannot change session name when session is active
- 1978 dot jl at gmail dot comBug #76358 [Com]: Cannot change session name when session is active
- cmb@php.netBug #76358 [Asn]: Cannot change session name when session is active
- yohgaki@php.netBug #76358 [Asn]: Cannot change session name when session is active