#36737 [Opn->Fbk]: session changes unsaved with register_long_arrays off

From: Date: Mon, 20 Mar 2006 22:22:08 +0000
Subject: #36737 [Opn->Fbk]: session changes unsaved with register_long_arrays off
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-94678@lists.php.net to get a copy of this message
ID: 36737 Updated by: tony2001@php.net Reported By: morriss at r-can dot com -Status: Open +Status: Feedback Bug Type: Session related Operating System: Windows Server 2003 PHP Version: 5.1.2 New Comment: Please try using this CVS snapshot: http://snaps.php.net/php5.1-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.1-win32-latest.zip Previous Comments: ------------------------------------------------------------------------ [2006-03-14 19:00:42] morriss at r-can dot com Description: ------------ I'm using the ISAPI filter in IIS6. With register_long_arrays off, the session variables are not always saved. Note that in my example, I found that assigning $sv=$_SESSION; always breaks it, but my webpage only does assignments like $sv=$_SESSION['idx'] yet is still broken. setting "register_long_arrays = On" in php.ini fixes the problem. Reproduce code: --------------- <head><title>test.php</title></head> <html> <body> <?php session_start(); $sv = $_SESSION; //broken! //$sv['idx'] = $_SESSION['idx']; //ok! if (isset($_SESSION['idx'])) $i = $_SESSION['idx'] + 1; else $i = 0; $_SESSION['idx'] = $i; session_write_close(); echo '<p>SESSION START: '.$sv['idx'].'</p>'; echo '<p>SESSION END: '.$_SESSION['idx'].'</p>'; ?> <a href="test.php">test</a> </body> </html> Expected result: ---------------- SESSION START: n SESSION END: n+1 (after clicking link) SESSION START: n+1 SESSION END: n+2 Actual result: -------------- SESSION START: n SESSION END: n+1 (does not change even after clicking link. Note that older session data is kept, if idx=3 when requesting the test page, then n=3) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36737&edit=1

« previous php.bugs (#94678) next »