| re: Session problems with register globals enabled
<snip>
[color=blue]
>
> Now with the newer PHP versions(that which comes with RH9 ) all this
> works perfectly.
> (Register globals is off and session.auto_start is 1 )
> But with older PHP versions 4.1.2 etc this script doesn't work because
> $_SESSION['bo_id'] is empty in the admin authentication script(2nd
> script).
> But this session variable is set in the login script !!
> (In old PHP versions register globals is on and session_auto_start is
> off)
>
> Can anyone plz tell me how to make this work in all PHP versions!!
>
> Thanx
> Manu[/color]
Hi Manu,
That is probably because $_SESSION[] array is new. So in your older versions
of PHP you just create the $_SESSION-array and store something in it.
That is why your other script cannot retrieve values from it because it
simply isn't there. (It is destroyed as the script ends)
You can always use $HTTP_SESSION_VARS[] to get/set values in your session,
allthough it is not superglobal as $_SESSION is.
So you should make it global if you cannot reach it somewhere (function).
Hope this helps.
Regards,
Erwin Moller |