From: antonr at game dot permonline dot ru Operating system: Irrelevant PHP version: 5CVS-2004-07-06 (dev) PHP Bug Type: Session related Bug description: Session are closed before all object destructors executed.
Description: ------------ Session are closed before all object destructors executed. It seems to be wrong, cause objects desctructors may save information in opened session. Reproduce code: --------------- <?php class MySession { public $number; public function __construct() { session_start(); $this->number = @$_SESSION["number"]; } public function Process() { $this->number++; } public function __destruct() { $_SESSION["number"] = $this->number; session_write_close(); } } $ss = new MySession(); $ss->Process(); echo $ss->number; ?> Expected result: ---------------- With every page reloading number in the page must increase by 1. Actual result: -------------- Everytime number is equal 1. -- Edit bug report at http://bugs.php.net/?id=29032&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29032&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29032&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=29032&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=29032&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=29032&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=29032&r=needscript Try newer version: http://bugs.php.net/fix.php?id=29032&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=29032&r=support Expected behavior: http://bugs.php.net/fix.php?id=29032&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=29032&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=29032&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=29032&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29032&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=29032&r=dst IIS Stability: http://bugs.php.net/fix.php?id=29032&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=29032&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=29032&r=float