#31483 [Fbk->Opn]: session_name() ignored in cookie

From: Date: Mon, 17 Jan 2005 20:41:50 +0000
Subject: #31483 [Fbk->Opn]: session_name() ignored in cookie
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-72322@lists.php.net to get a copy of this message
 ID:               31483
 User updated by:  andy at andycc dot net
 Reported By:      andy at andycc dot net
-Status:           Feedback
+Status:           Open
 Bug Type:         Session related
 Operating System: Redhat Linux Fedora 1
 PHP Version:      4.3.10
 New Comment:

Yep works, thanks!


Previous Comments:
------------------------------------------------------------------------

[2005-01-17 18:27:55] sniper@php.net

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip



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

[2005-01-13 18:22:30] andy at andycc dot net

Doesn't work with session.bug_compat_42 disabled either (as advised in
the error log.)

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

[2005-01-11 00:42:01] andy at andycc dot net

Description:
------------
php 4.3.10 configured with --with-mysql --with-apxs

When using your own session_name to call the cookie, PHP ignores it the
first time round, as in:

<?php

session_name("thisSession");
session_start();

?>

You have to set your session_name, start the session, destroy the
session, and start a new one to get it to recognise your name.

The cookie is still called "PHPSESSID" (the default in php.ini) the
first time round, but is ok the second.

The first code worked fine in 4.3.9.

Reproduce code:
---------------
<?php

session_name("thisSession");
session_start();

?>


Expected result:
----------------
A cookie called "thisSession" to be present in the browser.
(Using Mozilla Firefox, can view the cookie names.)



Actual result:
--------------
A cookie called "PHPSESSID" is present, but no "thisSession" cookie.

You have to use the following to destroy the session and set it
properly.

<?php

session_name("thisSession");
session_start();
session_destroy();
session_start();

?>



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


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


Thread (6 messages)

« previous php.bugs (#72322) next »