#21542 [Opn->Bgs]: variables bad values - register_global - session
| From: | iliaa@php.net | Date: | Fri, 10 Jan 2003 01:46:39 +0000 |
| Subject: | #21542 [Opn->Bgs]: variables bad values - register_global - session | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-29645@lists.php.net to get a copy of this message | ||
ID: 21542
Updated by: iliaa@php.net
Reported By: peton@cavalex.com
-Status: Open
+Status: Bogus
Bug Type: Session related
Operating System: Linux
PHP Version: 4.3.0
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Set session.bug_compat_warn to Off and the warning messages you are
seeing should go away.
Previous Comments:
------------------------------------------------------------------------
[2003-01-09 06:23:45] peton@cavalex.com
Hi,
a strange problem, with session and register_global.
The problem does not exist with PHP-4.2.3.
When you have a variable set to a undefined value of
$_SERVER array, and register_global set to ON, PHP set
all variables to the same value (the last value).
If you reload the page, there is no problem, it is only
the FIRST time you read the page where there is the
session variable is built.
If you try with an unset variable, there is no problem.
By the way, I don't understand the last message about
"Your script possibly relies on a session side-effect..."
when register_global is set to OFF.
Best Regards,
Nicolas
--- info PHP
PHP Version 4.3.0
register_argc_argv On
session.auto_start Off
session.bug_compat_42 On
session.bug_compat_warn On
session.cookie_domain no value
session.name PHPSESSID
session.use_cookies On
session.use_only_cookies Off
session.use_trans_sid Off
-------------- test.php -------------
+++SCRIPT+++
session_start();
$referer=$_SERVER['HTTP_REFERER']; # ERR (first time)
#$referer="----"; # OK (always)
session_register("referer");
echo "<PRE>"; echo session_encode(); echo "</PRE>";
$var1="V1";
$var2="V2";
$var3="V3";
echo "<BR>$var1 -- $var2 -- $var3 -- $var_not_affected\n";
+++
------- WITH register_global : On
At the first execution of ths script:
+++OUTPUT+++
referer|N;
V3 -- V3 -- V3 -- V3
+++
AND after reload:
+++OUTPUT+++
referer|N;
V1 -- V2 -- V3 --
+++
------- WITH register_global : Off
+++OUTPUT+++
referer|N;
V1 -- V2 -- V3 --
Warning: Unknown(): Your script possibly relies on a
session side-effect which existed until PHP 4.2.3.
Please be advised that the session extension does
not consider global variables as a
source of data, unless register_globals is enabled.
You can disable this functionality and this warning
by setting session.bug_compat_42 or
session.bug_compat_warn to off, respectively. in
Unknown on line 0
+++
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=21542&edit=1