From:             morriss at r-can dot com
Operating system: Windows Server 2003
PHP version:      5.1.2
PHP Bug Type:     Session related
Bug description:  session changes unsaved with register_long_arrays off

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 bug report at http://bugs.php.net/?id=36737&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=36737&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=36737&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=36737&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=36737&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=36737&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=36737&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=36737&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=36737&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=36737&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=36737&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=36737&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=36737&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=36737&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=36737&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=36737&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=36737&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=36737&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=36737&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=36737&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=36737&r=mysqlcfg

Reply via email to