#37444 [NEW]: Session not saved if $_SESSION array assigned as a whole array

From: Date: Mon, 15 May 2006 08:09:29 +0000
Subject: #37444 [NEW]: Session not saved if $_SESSION array assigned as a whole array
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-97092@lists.php.net to get a copy of this message
From: grueff at libero dot it Operating system: Win XP PHP version: 5.1.4 PHP Bug Type: Session related Bug description: Session not saved if $_SESSION array assigned as a whole array Description: ------------ If i put values in $_SESSION array by inserting them as array elements such as this: $_SESSION["a"]="test"; All does function ok; but if i prepare a whole array of values and put it in the session such as this: $prep=array("test1","test2","test3","test4"); $_SESSION=$prep; NOTHING gets written in the session, and any subsequest pages loading the session will get an empty session array. Reproduce code: --------------- This writes the session <?php session_start(); $tize=array("uno","due","tre","quattro","cinque","sei"); $_SESSION=$tize; print_r($_SESSION); ?> This tries to read the session: <?php session_start(); print_r($_SESSION); ?> Expected result: ---------------- Output the content of $tize array! Actual result: -------------- Outputs an empty array! -- Edit bug report at http://bugs.php.net/?id=37444&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37444&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=37444&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37444&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=37444&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=37444&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=37444&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=37444&r=needscript Try newer version: http://bugs.php.net/fix.php?id=37444&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=37444&r=support Expected behavior: http://bugs.php.net/fix.php?id=37444&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=37444&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=37444&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=37444&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37444&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=37444&r=dst IIS Stability: http://bugs.php.net/fix.php?id=37444&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=37444&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=37444&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=37444&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=37444&r=mysqlcfg

« previous php.bugs (#97092) next »