From: dkaplan1 at uiuc dot edu Operating system: Solaris SunOS 5.9 PHP version: 4.3.1 PHP Bug Type: Session related Bug description: sessions not overwritten properly
Description: ------------ Data that is newly written to the session hash is not getting stored correctly. If I am storing two pieces of data (a string and a type of view for example) in the session hash, the hash should only contain the latest values of those two variables. Instead, as in the example provided, the form randomly changes between the views, and the data shown is not always the latest in the hash. Usually, it is from previous submissions. This seems to be a problem in IE and Netscape, but not in Mozilla. Reproduce code: --------------- <? session_cache_limiter('public'); session_start(); if (isset($_POST['submit'])) { $_SESSION['data']=$_POST['data']; } if (isset($_GET['form'])) { $_SESSION['form']=$_GET['form']; } if (!isset($_SESSION['form'])) { $_SESSION['form']='basic'; } if ($_SESSION['form']=='basic') { echo 'The value of the variable is '.$_SESSION['data']; } if ($_SESSION['form']=='advanced') { echo 'Here is a complete dump of the session hash '; var_dump($_SESSION); } ?><br><br> <a href=bug.php?form=basic>Basic</a><br><a href=bug.php?form=advanced>Advanced</a><br> <form method=post action=bug.php>Data: <input type=text name=data value=""> <input type=submit name=submit value=submit></form> Expected result: ---------------- When you type in a value, it should appear. When you switch views, the data value should stay the same, only the view changes. When you enter different data, only the data changes, the view stays the same. Actual result: -------------- View randomly changes and data is not always last entered. -- Edit bug report at http://bugs.php.net/?id=24810&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=24810&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=24810&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=24810&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=24810&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=24810&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=24810&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=24810&r=support Expected behavior: http://bugs.php.net/fix.php?id=24810&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=24810&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=24810&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=24810&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24810&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=24810&r=dst IIS Stability: http://bugs.php.net/fix.php?id=24810&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=24810&r=gnused