From: dzlist at zverina dot co dot uk
Operating system: linux
PHP version: Irrelevant
PHP Bug Type: Session related
Bug description: iterating over _SESSION will stuff up session saving
Description:
------------
Using up to date version from RedHat 8.0, 4.2.2
Calling the function below will stuff up saving of _ALL_ session data:
Reproduce code:
---------------
function import_session_variables ($prefix)
{
global $_SESSION;
$tab = $_SESSION;
reset($tab);
while (!is_null($key = key($tab) ) ) {
$var = $prefix.$key;
global $$var;
$$var = $_SESSION[$key];
next($tab);
}
// if you uncomment the next line sessions will save
// hence i have a work around
// it'd be nice to have it fixed properly though
// reset($tab);
}
Expected result:
----------------
import all the session variable
AND the session should still save correctly
Actual result:
--------------
imports all the session variables
BUT sessions ARE NOT saved
--
Edit bug report at http://bugs.php.net/?id=24728&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=24728&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=24728&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=24728&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=24728&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=24728&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=24728&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=24728&r=support
Expected behavior: http://bugs.php.net/fix.php?id=24728&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=24728&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=24728&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=24728&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24728&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=24728&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=24728&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=24728&r=gnused