#31022 [Opn->Bgs]: Using '_' in a hostname causes sessions to break
| From: | derick@php.net | Date: | Wed, 08 Dec 2004 14:09:05 +0000 |
| Subject: | #31022 [Opn->Bgs]: Using '_' in a hostname causes sessions to break | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-69934@lists.php.net to get a copy of this message | ||
ID: 31022
Updated by: derick@php.net
Reported By: spam at taylorw dot com
-Status: Open
+Status: Bogus
Bug Type: *Configuration Issues
Operating System: Gentoo Linux
PHP Version: 4.3.9
New Comment:
_ is not allowed in domain names, so no bug here.
Previous Comments:
------------------------------------------------------------------------
[2004-12-08 15:02:02] spam at taylorw dot com
Description:
------------
Previously I submitted a bug report about sessions not working, in the
sense that every session_start() call created a new session, and a new
file in /tmp. I have concluded that the host name "spare_ribs" was the
issue. By changing the hostname to "spareribs" (no '_') the session
issue is fixed. I am not sure if using '_' in a hostname is against
some RFC and thus this is not really a bug, but I think that since bind
accepted it, and the two browsers I tried with it worked fine, this is
not breaking protocol and should work fine.
(Apache 2.0.52 being used here.)
Reproduce code:
---------------
Set hostname to anything with _ such as "spare_ribs". Then reboot box
and browse to page one which includes the following code.
/* Page 1 */
<?php
session_start();
$_SESSION['test'] = 'this is a test.';
echo $_SESSION['test'];
echo '<a href="page2.php">click here for page 2</a>';
?>
/* Page 2 */
<?php
session_start();
echo 'You should see this is a test:';
echo $_SESSION['test'];
echo '<a href="page1.php">click here for page 1</a>';
?>
Expected result:
----------------
Page one should say 'this is a test', and page two should say 'You
should see this is a test: this is a test'.
Actual result:
--------------
However page two only says 'You should see this is a test'. And a new
session id has been assigned, as well as a new session created in /tmp.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31022&edit=1