#34542 [Opn->Bgs]: register_long_arrays causes $_SESSIONS vars to disappear

2007-07-25 Thread jani
 ID:   34542
 Updated by:   [EMAIL PROTECTED]
 Reported By:  marcus dot uy at virtualthinking dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Session related
 Operating System: ALL
 PHP Version:  5.1.0RC4, 5.2.0
 New Comment:

Yes, $_SESSION is special. RTM: http://www.php.net/session


Previous Comments:


[2007-07-25 04:54:02] marcus dot uy at virtualthinking dot com

Hi,

I have resolved this issue.  It's not that the long arrays that is
broken, but that $_SESSION has some unexpected behaviours.

It turns out that $_SESSION is NOT really a normal array.  If you
assign a bunch of values to $_SESSION as an array, e.g.:

$_SESSION = array ("value1", "value2", "value3");

It destroy's the "magic" of $_SESSION and session becomes a standard
array (that vanishes on script exit), thus it does not save settings as
expected.

There have been some similar complaints in other bug reports.  The
discussion breaks down into two camps:

1. This is a feature, so don't allocate the array
2. This fails the test of "least surprise", behaviour should be
"corrected"

Ah well, it works now, and I know why, so that's what matters.



[2006-12-05 15:37:58] [EMAIL PROTECTED]

>Like on Windows, "register_long_arrays=On" causes the
> described problem with the session too.
No, it doesn't.
With register_long_arrays=On I get the same result, as with Off. It
works perfectly fine.

I guess you have some kind of broken browser and/or some combination of
Apache modules or PHP/Zend extensions, which cause it. By the way, you
didn't answer my question on zend_extensions.



[2006-12-05 15:12:33] marcus dot uy at virtualthinking dot com

Just a quick update.  A correction on the Linux settings.  Like on
Windows, "register_long_arrays=On" causes the described problem with the
session too.

My bad.  Did not notice that the option was commented out.



[2006-11-29 12:15:40] marcus dot uy at virtualthinking dot com

mod_security removed.  Behaviour of PHP is still the same as my
previous post.

I have tested the same php.ini file on a separate linux server (with
path names adjusted for linux) that I own and it works with
register_long_arrays=off in the expected manner as documented.

The same settings on windows fail to work as noted earlier.

I cannot verify this, but is there some internal reference or
dependency in the session subsystem that uses the old long array
vars/buffer as the input source for the data that is written to the
session file?

Hence:

$_SESSION => can show up during the run
...but...
$HTTP_SESSION_VAR => written to disk, and thus empty

Any chance?  Was discussing fault scenarios with a friend and this came
up as a plausible case that would result in this kind of oddity (a
difference in how the windows and linux compilers work might account for
the difference in behaviour on different platforms???).



[2006-11-29 10:08:15] [EMAIL PROTECTED]

First of all, please remove/disable mod_security.



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/34542

-- 
Edit this bug report at http://bugs.php.net/?id=34542&edit=1


#34542 [Opn->Bgs]: register_long_arrays causes $_SESSIONS vars to disappear

2005-12-11 Thread sniper
 ID:   34542
 Updated by:   [EMAIL PROTECTED]
 Reported By:  marcus dot uy at virtualthinking dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Session related
 Operating System: WinXP Pro
 PHP Version:  5.1.0RC4
 New Comment:

This still doesn't happen.


Previous Comments:


[2005-12-11 08:32:37] marcus dot uy at virtualthinking dot com

There have been test cases posted for this bug.  Please review.



[2005-11-11 01:00:24] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".



[2005-11-10 17:06:42] uap-php at cheeky dot org

Hello,

Having similar problems on 5.0.5.  Basically all I can say is, if you
have register_long_arrays=Off in your ini file, $_SESSION stuff does
work, apart from when you iterate over it.  Run the code below, with
register_long_arrays=On and then with it off.  The final result will be
different.  It seems that if you iterate over $_SESSION, the
session_save handler does not get called and the session data is not
saved.

Hope this sheds some light on the problem,


$value){
$_SESSION[$key]='';
}
$step='empty session "search_test"';
$refresh='';
break;
case 1:
$step='nothing set in this step';
$refresh='';
break;
default:
$_SESSION['search_test'] = 'Hello!';
$step='set session "search_test" to "Hello"';
$refresh='';
}

?>

Session Data:';
print_r($_SESSION);
echo '';

?>




[2005-11-09 23:43:51] mail at lenzw dot de

see Bug #33811 for a reproduction code.



[2005-11-03 22:10:18] [EMAIL PROTECTED]

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 ,
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.





The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/34542

-- 
Edit this bug report at http://bugs.php.net/?id=34542&edit=1