#40973 [Opn->Fbk]: session don't work if used $_SERVER in any way
| From: | tony2001@php.net | Date: | Wed, 04 Apr 2007 18:06:53 +0000 |
| Subject: | #40973 [Opn->Fbk]: session don't work if used $_SERVER in any way | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-111107@lists.php.net to get a copy of this message | ||
ID: 40973
Updated by: tony2001@php.net
Reported By: krassesache at gmx dot net
-Status: Open
+Status: Feedback
Bug Type: Session related
Operating System: WinXP SP2
PHP Version: 5.2.1
New Comment:
Works perfectly fine whatever I do and doesn't depend on the value
ofsession.referer_check.
Previous Comments:
------------------------------------------------------------------------
[2007-04-04 16:24:42] krassesache at gmx dot net
ich got it!!!
if i set
session.referer_check = 1
session.referer_check = 0
in php.ini, the problem appears
if i set it to
session.referer_check =
the session will work?!
------------------------------------------------------------------------
[2007-04-04 16:04:25] tony2001@php.net
Cannot reproduce.
------------------------------------------------------------------------
[2007-04-04 16:01:05] krassesache at gmx dot net
i also used php 5.2 with the same result.
------------------------------------------------------------------------
[2007-04-03 18:58:35] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
Works perfectly fine.
------------------------------------------------------------------------
[2007-04-01 16:12:13] krassesache at gmx dot net
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 this bug report at http://bugs.php.net/?id=40973&edit=1