From:             phpbugs at asystance dot nl
Operating system: Windows XP / Debian Linux
PHP version:      Irrelevant
PHP Bug Type:     Documentation problem
Bug description:  register_globals makes $_SESSION misbehave

Description:
------------
When register_globals = On (I know this is legacy), $_SESSION behaves
differently than the other superglobals and this (mis)behaviour is not
documented.

This is actually a duplicate of (or maybe just related to) bug #25110.
[EMAIL PROTECTED] calls this behaviour a "feature". I strongly disagree.

What we should agree on is that it's undocumented and unexpected. Neither
the documentation on register_globals nor the documentation on
superglobals mentions this. It also only works with $_SESSION (and not
with other superglobals), so the behaviour is very unexpected.

I tested this with two debian installations (4.4.2-1+b1 on Apache 2.0.55
and 4.3.10-16.8 on Apache 1.3.33) and the latest Windows zip package 4.4.2
on Apache2.

Reproduce code:
---------------
<?php
session_start();
$_SESSION['var'] = 'hello';
$var = 'again';
echo $_SESSION['var'];
?>


Expected result:
----------------
Output is 'hello'

Actual result:
--------------
Output is 'again'

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

Reply via email to