#32886 [NEW]: Session dont store the correct values
From: luis at infomed dot sld dot cu
Operating system: Linux & Windows
PHP version: 5.0.4
PHP Bug Type: Session related
Bug description: Session dont store the correct values
Description:
------------
php5.0.4 dont store the correct values after modified the $_SESSION
variable, the idea is to clear the session and do persist only a few
values. I use Apache 1.3.33. With php5.0.2 everything is fine the problem
appear with php5.0.4, I am not try with php5.0.3
Reproduce code:
---------------
page1.php-----------------------------------------
<?php
session_start();
$_SESSION['varA'] = 'aaa';
$_SESSION['varB'] = 'bbb';
?>
page2.php-----------------------------------------
<?php
session_start();
$buffer['varA'] = $_SESSION['varA'];
$_SESSION = array();
$_SESSION = $buffer;
print_r($_SESSION);
?>
page2b.php-----------------------------------------
<?php
session_start();
$_SESSION = array();
$_SESSION['varA'] = 'aaa';
print_r($_SESSION);
?>
page3.php-----------------------------------------
<?php
session_start();
print_r($_SESSION);
?>
Expected result:
----------------
I would expect the same behavior with:
page1.php->page2.php->page3.php
and with:
page1.php->page2b.php->page3.php
but is not.
Actual result:
--------------
When I do page1.php->page2.php on the screen I obtain the correct values:
Array ( [varA] => aaa )
but on the session file in disc is wrong, because the session file have:
varA|s:3:"aaa";varB|s:3:"bbb";
and in page3.php on the screen I have:
Array ( [varA] => aaa [varB] => bbb ), is wrong.
But, if I do page1.php->page2b.php->page3.php everything is fine.
Thank you for your work in PHP.
--
Edit bug report at http://bugs.php.net/?id=32886&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32886&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32886&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32886&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32886&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32886&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32886&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32886&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32886&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32886&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32886&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=32886&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=32886&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32886&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32886&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32886&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32886&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32886&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32886&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32886&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32886&r=mysqlcfg
Thread (8 messages)
- luis at infomed dot sld dot cu