Re: Support Reference -- Import Script

[email protected] (mikespub) Thu, 24 Apr 2003 14:48:00 GMT
Newsgroups gmane.comp.cms.xaraya.knowledge-base
Organization not much
Message-ID <[email protected]>
In article <b88p9k$ear$1-FogMEOs31dotat4ziPANHlKoq+OfwspIAL8bYrjMMd8@public.gmane.org>, Marcel van der Boom <[email protected]> wrote:
>...
>> I suppose you're not working with PHP 4.1.2, but with some higher
>> version ? In which case the "pollution" is probably happening
>> somewhere in the newer session code - at least that would be
>> my first guess...
>> 
>4.2.3 here
>
Aha - finally I can reproduce this :)

- PHP 4.1.2 on Windows with register_globals Off - works OK
- PHP 4.1.2 on Windows with register_globals On - works OK
- PHP 4.2.1 on Windows with register_globals Off - works OK
- PHP 4.2.1 on Windows with register_globals On - weird stuff

Apparently, whatever $uid was used last in a particular import
step becomes the new uid session variable when the session
is saved, as long as register_globals is set On.

Incidently, the xar_uid field in xar_session_info still contains the
correct value - only the session variables in xar_vars are messed
up. So the "old-style" session code works correctly, but since the
"new-style" session code doesn't believe in using xar_uid anymore,
it gets to use the wrong uid from session variables each time...

Now the only remaining question is whether a (non-global) $uid
could mess up $_SESSION['uid'] all by itself, or whether there's
some function call that deliberately (and wrongly) sets this value.
Since register_globals seems to affect this, my guess would be
that using $uid manages to mess things up all by itself, but I
might be wrong there.

And of course fix this whole session mess for 4.2+ again :-(

Mike.