ID: 34542 Updated by: [EMAIL PROTECTED] Reported By: marcus dot uy at virtualthinking dot com -Status: Open +Status: Feedback Bug Type: Session related Operating System: WinXP Pro PHP Version: 5.1.0RC1 New Comment:
Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If possible, make the script source available online and provide an URL to it here. Try to avoid embedding huge scripts into the report. Previous Comments: ------------------------------------------------------------------------ [2005-09-19 12:38:07] marcus dot uy at virtualthinking dot com Hi just tried it with the CVS versions to popinted me to. No dice. Same problem. After the session is created as a zero-length file and updating $_SESSION in the script does nothing to change this. The values are accessible during the first run, and when re-read on subsequent runs, understandably return an empty $_SESSION array. FYI, my application is split into a public http system and a private https system. The session sticks in the http session, but as noted earlier, the number of session values used is significantly less than after a user has logged in the https session. I allow the script to generate a new SID for the https session as I do not need to pass over the values, and it is here that the values do not stick. Both the http and https sites share an *indentical* code base so it's not a program error. Erm, to be honest the code I posted is cut down to allow for it to be a reasonable length. It incorporates the essentials of the problem, but perhaps not the full environment. It still needs the register_long_arrays to be "on" before it will work. ------------------------------------------------------------------------ [2005-09-18 22:07:55] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip I can't reproduce this on either Linux or Windows. (using sessions with cookies, of course, passing session ids in the URL is not wise) ------------------------------------------------------------------------ [2005-09-18 15:34:38] marcus dot uy at virtualthinking dot com 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 this bug report at http://bugs.php.net/?id=34542&edit=1