[nycphp-talk] $_SESSION, session_unset(), unset($_SESSION['var']), register_globals and the PHP Manual
Phillip Powell
phillip.powell at adnet-sys.com
Fri Jul 23 16:44:20 EDT 2004
Scott Mattocks wrote:
> Phillip Powell wrote:
>
>> Did this include PHP 4.3.6 as well?
>>
>> I was told that you cannot change the value of an autoglobal in a
>> function or method with register_globals on and expect to retain that
>> change upon exit, you'd have to globalize the autoglobal before you
>> exit.
>
>
> That doesn't make any sense. A global's scope is global. If your
> changes don't affect the variable in the global scope then it isn't a
> really a global is it? I have a hard time believing that in 4.3.6 a)
> $_SESSION is not a global and/or b) the value of register_globals has
> any effect on the way unset() works.
>
> I don't think that the PHP version or the state of register_globals is
> your problem, but you could check the change log to see what has
> changed between the two versions.
I read the change logs in PHP 4.3.2 vs PHP 4.3.6 in the PHP manual and
it was hard to follow. Therefore, I did a hack and it worked:
[PHP]
if ((int)ini_get('register_globals') === 1) ini_set('register_globals',
false);
session_cache_limiter();
session_start();
// REST OF CODE
[/PHP]
Phil
>
> Scott Mattocks
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
>
--
---------------------------------------------------------------------------------
Phil Powell
Multimedia Programmer
BPX Technologies, Inc.
#: (703) 709-7218 x107
Fax: (703) 709-7219
More information about the talk
mailing list