For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > May 2006 > #37629 [NEW]: register_globals makes $_SESSION misbehave









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author #37629 [NEW]: register_globals makes $_SESSION misbehave
phpbugs at asystance dot nl

2006-05-29, 6:59 pm

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.
sniper@php.net 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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com