[PHP-DEV] REVIEW: Imminent session patch

2002-10-02 Thread Sascha Schumann
Could some kind soul with a thorough understanding of the engine details please review the attached patch? Changes: - Fix two simple memory leaks. - Fix a bug which did not initialize $_SESSION, if is_array($HTTP_SESSION_VARS) was true. - Sascha Index: session.c

Re: [PHP-DEV] REVIEW: Imminent session patch

2002-10-02 Thread Ilia A.
On October 2, 2002 05:13 am, Sascha Schumann wrote: > Could some kind soul with a thorough understanding of the > engine details please review the attached patch? > > Changes: > > - Fix two simple memory leaks. > - Fix a bug which did not initialize $_SESSION, if > is_arr

Re: [PHP-DEV] REVIEW: Imminent session patch

2002-10-02 Thread Sascha Schumann
> believe should be addressed. The problem being that session_register() > function does not work unless the user has register_globals enabled. I think there is a misunderstanding with regard to how sessions interact with global variables. The session extension makes use of globals o

Re: [PHP-DEV] REVIEW: Imminent session patch

2002-10-02 Thread Tit \"Black\" Petric
> (snip).. There is however another problem, which I > believe should be addressed. The problem being that session_register() > function does not work unless the user has register_globals enabled. > This particular problem causes problems for anyone using php software that was > written before thi

Re: [PHP-DEV] REVIEW: Imminent session patch

2002-10-02 Thread Derick Rethans
On Wed, 2 Oct 2002, Tit "Black" Petric wrote: > correct me if i am wrong, but with $_SESSION you dont even need to have > session_register() anymore, as for the behaviour of session_register(), if > it held up to the latest php version, i dont see any sense of changing its > functionality now, it

Re: [PHP-DEV] REVIEW: Imminent session patch

2002-10-02 Thread Ilia A.
On October 2, 2002 02:31 pm, Sascha Schumann wrote: > > believe should be addressed. The problem being that session_register() > > function does not work unless the user has register_globals enabled. > > I think there is a misunderstanding with regard to how > sessions interact with global

Re: [PHP-DEV] REVIEW: Imminent session patch

2002-10-02 Thread Sascha Schumann
> Its very simply really, as you well know, since PHP 4.2.0 register_globals are > off by default. Because they are off, session_register does not retrieve a > value from the variable and only creates a null variable inside the session. > So, unless the user is aware of this issue and knows that t

Re: [PHP-DEV] REVIEW: Imminent session patch

2002-10-02 Thread Ilia A.
On October 2, 2002 03:46 pm, Sascha Schumann wrote: > > Its very simply really, as you well know, since PHP 4.2.0 > > register_globals are off by default. Because they are off, > > session_register does not retrieve a value from the variable and only > > creates a null variable inside the session.

Re: [PHP-DEV] REVIEW: Imminent session patch

2002-10-02 Thread Rasmus Lerdorf
I really don't see why would want to deprecate session_register(). Regardless of whether register_globals is on or off, code like this works fine: Set a session var: session_register('a'); $a=1; Get a session var: session_start(); $a = $_SESSION['a']; This makes perfect sense to me and

Re: [PHP-DEV] REVIEW: Imminent session patch

2002-10-02 Thread Ilia A.
On October 2, 2002 04:26 pm, Rasmus Lerdorf wrote: > I really don't see why would want to deprecate session_register(). > Regardless of whether register_globals is on or off, code like this works > fine: > > Set a session var: > session_register('a'); > $a=1; That example only works when regi

Re: [PHP-DEV] REVIEW: Imminent session patch

2002-10-02 Thread Sascha Schumann
On Wed, 2 Oct 2002, Rasmus Lerdorf wrote: > I really don't see why would want to deprecate session_register(). > Regardless of whether register_globals is on or off, code like this works > fine: > > Set a session var: > session_register('a'); > $a=1; > > Get a session var: > session_start()

Re: [PHP-DEV] REVIEW: Imminent session patch

2002-10-02 Thread Rasmus Lerdorf
> On Wed, 2 Oct 2002, Rasmus Lerdorf wrote: > > > I really don't see why would want to deprecate session_register(). > > Regardless of whether register_globals is on or off, code like this works > > fine: > > > > Set a session var: > > session_register('a'); > > $a=1; > > > > Get a session var

Re: [PHP-DEV] REVIEW: Imminent session patch

2002-10-02 Thread Rasmus Lerdorf
> That example only works when register_globals are on. When they are off, it Up until 4.3 it worked just fine. -Rasmus -- PHP Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] REVIEW: Imminent session patch

2002-10-02 Thread Andrei Zmievski
On Wed, 02 Oct 2002, Sascha Schumann wrote: > Uh, how ugly. This has never been supported intentionally. > Looks like a result of multiple people modifying code and not > talking to each other. > > Note that the docs for session_register are out of date. It > is supposed to

Re: [PHP-DEV] REVIEW: Imminent session patch

2002-10-02 Thread Sascha Schumann
> But that is a bit of a twist of what "register_globals" is supposed to > mean. As far as I am concerned register_globals only affects how data is > imported into PHP. Having that flag trigger other behaviours is > completely undocumented and outside the scope of the original intent of > regist

Re: [PHP-DEV] REVIEW: Imminent session patch

2002-10-02 Thread Rasmus Lerdorf
Hrm, but that documentation is very out of date and didn't match the code even when it was written. On Wed, 2 Oct 2002, Sascha Schumann wrote: > > But that is a bit of a twist of what "register_globals" is supposed to > > mean. As far as I am concerned register_globals only affects how data is

Re: [PHP-DEV] REVIEW: Imminent session patch

2002-10-02 Thread Sascha Schumann
On Wed, 2 Oct 2002, Rasmus Lerdorf wrote: > > That example only works when register_globals are on. When they are off, it > > Up until 4.3 it worked just fine. Yes, there were a series of modification with regard to $_SESSION which -- modified some of the behaviour. get_session_var

Re: [PHP-DEV] REVIEW: Imminent session patch

2002-10-02 Thread Sascha Schumann
On Wed, 2 Oct 2002, Rasmus Lerdorf wrote: > Hrm, but that documentation is very out of date and didn't match the code > even when it was written. Huh, excuse me, would you please leave that judgement to the authors of the code and the documentation (Andrei and me). The documentation

Re: [PHP-DEV] REVIEW: Imminent session patch

2002-10-02 Thread Rasmus Lerdorf
On Wed, 2 Oct 2002, Sascha Schumann wrote: > On Wed, 2 Oct 2002, Rasmus Lerdorf wrote: > > > Hrm, but that documentation is very out of date and didn't match the code > > even when it was written. > > Huh, excuse me, would you please leave that judgement to the > authors of the code and t

Re: [PHP-DEV] REVIEW: Imminent session patch

2002-10-02 Thread Sascha Schumann
> I am assuming this documentation was not written recently since it talks > about track_vars and there is no way to turn off track_vars today. And You are right -- it was not written recently. The semantics of the session module have not changed since then though. If a bug tempora

Re: [PHP-DEV] REVIEW: Imminent session patch

2002-10-02 Thread Rasmus Lerdorf
> > I am assuming this documentation was not written recently since it talks > > about track_vars and there is no way to turn off track_vars today. And > > You are right -- it was not written recently. The semantics > of the session module have not changed since then though. If > a

Re: [PHP-DEV] REVIEW: Imminent session patch

2002-10-02 Thread Sascha Schumann
> Are you sure it was only 4.2? I seem to remember seeing similar code in > 4.1. Possibly. We changed the serialization strategy which is appealing because of its simplicity, but it is not backwards compatible. I'll commit my changes so far (the patch I posted earlier), tag