From:             krassesache at gmx dot net
Operating system: WinXP SP2
PHP version:      5.2.1
PHP Bug Type:     Session related
Bug description:  session don't work if used $_SERVER in any way

Description:
------------
if i use $_SERVER in any way but with pdo statements [
$stmt->execute(array($_SERVER['REMOTE_ADDR'])) ] a session will not work.

in my example i first open foobar.php and then foobar2.php. if remove the
4th line in foobar2.php [ $var = $_SERVER['REMOTE_ADDR']; ] the the text
"bar" appears but with the line, nothing happens. in other case is used
preg_match('#MSIE#',$_SERVER['HTTP_USER_AGENT']) with the result that the
website will be shown but the session dont work (the original problem).

Reproduce code:
---------------
=> foobar.php
<?php

session_start();
$_SESSION['foo'] = 'bar';

?>

=> foobar2.php
<?php

session_start();
$var = $_SERVER['REMOTE_ADDR'];
echo $_SESSION['foo'];

?>

Expected result:
----------------
bar

Actual result:
--------------
<nothing>

-- 
Edit bug report at http://bugs.php.net/?id=40973&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40973&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40973&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40973&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=40973&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=40973&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=40973&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=40973&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=40973&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=40973&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=40973&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=40973&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=40973&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=40973&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40973&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=40973&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=40973&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=40973&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40973&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=40973&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=40973&r=mysqlcfg

Reply via email to