#35233 [Opn->Bgs]: session_name gives bad result with session.auto_start=true

From: Date: Wed, 16 Nov 2005 09:24:17 +0000
Subject: #35233 [Opn->Bgs]: session_name gives bad result with session.auto_start=true
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-88249@lists.php.net to get a copy of this message
ID: 35233 Updated by: tony2001@php.net Reported By: gandalf at flock dot com -Status: Open +Status: Bogus Bug Type: Session related Operating System: * PHP Version: 5.0.5 New Comment: Why is that a bug? session_name() *does* change the session name, but it's too late, because session has already been started. So the session_name() behaviour is correct. Previous Comments: ------------------------------------------------------------------------ [2005-11-16 04:50:54] gandalf at flock dot com Description: ------------ As mentioned in bugs 1988 and 16389 when you set up session.auto_start=true, then you can't play with session_name. It's ok. But if so, then session_name() should return the REAL name, not the false one. It's totally misleading to accept session name change (without an Exception). Reproduce code: --------------- 1) Set session.auto_start=true in php.ini 2) <?php session_name('foo'); session_start(); print('Session name: '.session_name()); ?> Expected result: ---------------- Session name: PHPSESSID Actual result: -------------- Session name: foo 'session_name()' should give the real session cookie name. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=35233&edit=1

« previous php.bugs (#88249) next »