Bug #75650 [Opn->Csd]: Why this warning? "Cannot change session name when session is active"?

From: Date: Sat, 09 Dec 2017 17:45:50 +0000
Subject: Bug #75650 [Opn->Csd]: Why this warning? "Cannot change session name when session is active"?
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213035@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75650&edit=1

 ID:                 75650
 User updated by:    david dot stoeckl at blackbam dot at
 Reported by:        david dot stoeckl at blackbam dot at
 Summary:            Why this warning? "Cannot change session name when
                     session is active"?
-Status:             Open
+Status:             Closed
 Type:               Bug
 Package:            Session related
 PHP Version:        7.2.0
 Block user comment: N
 Private report:     N

 New Comment:

Closed as actually not a bug.


Previous Comments:
------------------------------------------------------------------------
[2017-12-09 17:45:00] david dot stoeckl at blackbam dot at

Well I see the problem. It is actually that it never worked like I thinked it was working. Multiple
sessions acutally are created using session_id() according to this document, session_name() always
means the current session.

Related: https://stackoverflow.com/questions/24964699/php-how-can-i-create-multiple-sessions

------------------------------------------------------------------------
[2017-12-07 18:37:42] spam2 at rhsoft dot net

because it never worked how you did think it worked but just silent

session_name(self::$name); // this is line 137
session_set_cookie_params(0, COOKIEPATH, null, self::$force_ssl_cookie, true);

both are nonsense when the session is already running

> according to the docs with session_name I could change sessions and start multiple sessions

where is that statet and how should that work since the session is tied to the session cookie?

> unset($_COOKIE[session_name()]);
> session_destroy();

what is that and why?
$_SESSION = array();
session_destroy();

and leave the cookie alone!

------------------------------------------------------------------------
[2017-12-07 18:20:55] david dot stoeckl at blackbam dot at

Description:
------------
Please have a look at the following discussion: https://stackoverflow.com/questions/47700336/php-7-2-warning-cannot-change-session-name-when-session-is-active



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=75650&edit=1


Thread (4 messages)

« previous php.bugs (#213035) next »