#32168 [NEW]: A recovering of variable while using reference to $_SESSION
| From: | KRomas at goldentele dot com | Date: | Thu, 03 Mar 2005 10:42:54 +0000 |
| Subject: | #32168 [NEW]: A recovering of variable while using reference to $_SESSION | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-76753@lists.php.net to get a copy of this message | ||
From: KRomas at goldentele dot com
Operating system: Linux
PHP version: 4.3.9
PHP Bug Type: Session related
Bug description: A recovering of variable while using reference to $_SESSION
Description:
------------
If we erase the $_SESSION and then make the reference to some session
variable X, the value of X is recovering, ie not erased.
Configure Command:
./configure' '--prefix=/usr/local/apache'
'--with-config-file-path=/usr/local/Zend/etc' '--enable-track-vars'
'--with-apxs=/usr/local/apache/bin/apxs' '--with-gd'
'--with-oci8=/oracle/8.1.7' '--enable-trans-sid' '--enable-sigchild'
'--with-zlib' '--enable-sockets' '--with-zlib-dir=/usr/local/include'
'--with-iconv' '--with-iconv-dir=/usr/local' '--disable-debug'
'--with-sybase-ct=/usr/local/freetds'
Reproduce code:
---------------
Please run folow files in order:
1.php
<?
session_start();
$_SESSION = Array();
$_SESSION['a']['b'] = 1;
echo '<PRE>';
var_dump($_SESSION);
?>
2.php
<?
session_start();
$_SESSION = Array();
//unset($_SESSION['a']);
//session_unregister('a');
//$val = $_SESSION['a'];
$val = & $_SESSION['a'];
echo '<PRE>';
var_dump($_SESSION);
?>
3.php
<?
session_start();
echo '<PRE>';
var_dump($_SESSION);
?>
Expected result:
----------------
array(1) {
["a"]=>
&NULL
}
Actual result:
--------------
array(1) {
["a"]=>
&array(1) {
["b"]=>
int(1)
}
}
--
Edit bug report at http://bugs.php.net/?id=32168&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32168&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32168&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32168&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32168&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32168&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32168&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32168&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32168&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32168&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32168&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=32168&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=32168&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32168&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32168&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32168&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32168&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32168&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32168&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32168&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32168&r=mysqlcfg