From:             marcus dot uy at virtualthinking dot com
Operating system: WinXP Pro
PHP version:      5.1.0RC1
PHP Bug Type:     Session related
Bug description:  register_long_arrays causes $_SESSIONS vars to disappear

Description:
------------
hi,

I have read through some earlier bug posts regarding similar-ish in later
versions of php4 and early versions of php5.

I want to report that this bug persists in version 5.0.4, 5.0.5, as well
as 5.1.0rc1 too.

Setting "register_long_arrays=off" causes $_SESSION to break, but in a
very unusual way.

For some reason putting 4 or 5 small items in the sessions array is fine
(which is why most tests can pass), but putting more data or more items in
the sessions array prevents the data from being written to the session
file.  You get a zero-length file and the session fails.

There is no error that faults or reports from this.

I haven't really measured the "breaking point", but it is real and I can
consistently reproduce it on my system (the code is way too long to post
here).

I note that php.ini doesn't seem to indicate the default status of this
setting, but if "off" is the default value then this bug does not seem to
affect linux versions of php.

Turning "on" register_long_arrays in php.ini restores full functionality. 
I suppose then, that this would be the near term work around.

Reproduce code:
---------------
page1.php
<?php
 session_start ();
 $_SESSION['login']       = "marcus.uy";
 $_SESSION['password']    = "blahblahblah";
 $_SESSION['memory']      = "abcdefghijklmnopqrstuvwxyz";
 $_SESSION['userid']      = 1;
 $_SESSION['userlevel']   = 10;
 $_SESSION['usergroup']   = -1;
 $_SESSION['accesslevel'] = 10;
 $_SESSION['accessgroup'] = -1;
 $_SESSION['auth']        = "NATIVE";
 $_SESSION['auth_ip']     = "127.0.0.1";

 echo ("<a href=\"/page2.php?".SID."\">Test Session</a>");
 ?>

page2.php?sid=1234567890abcdef
<?php
 session_start ();
 print_r ($_SESSION);
 ?>

Expected result:
----------------
Array
(
 ['login']       = "marcus.uy";
 ['password']    = "blahblahblah";
 ['memory']      = "abcdefghijklmnopqrstuvwxyz";
 ['userid']      = 1;
 ['userlevel']   = 10;
 ['usergroup']   = -1;
 ['accesslevel'] = 10;
 ['accessgroup'] = -1;
 ['auth']        = "NATIVE";
 ['auth_ip']     = "127.0.0.1";
)

Actual result:
--------------
Array
(
)

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

Reply via email to