From:             spam at taylorw dot com
Operating system: Gentoo Linux
PHP version:      4.3.9
PHP Bug Type:     *Configuration Issues
Bug description:  Using '_' in a hostname causes sessions to break

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 bug report at http://bugs.php.net/?id=31022&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31022&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=31022&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=31022&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31022&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31022&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31022&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31022&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31022&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31022&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31022&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=31022&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=31022&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31022&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31022&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31022&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31022&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31022&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31022&r=float
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31022&r=mysqlcfg

Reply via email to