Hello,
Can anyone suggest what the problem is in the code below ?
function is_logged_in() {
mylog(session_is_registered('userid'));
mylog($HTTP_SESSION_VARS['userid']);
mylog($GLOBALS['userid']);
if (session_is_registered('userid') && ($HTTP_SESSION_VARS['userid']!=''))
{$logged=1;}
else { $logged=0; }
return $logged;
}
Fist mylog returns true, second returns empty string, and only third returns what is supposed to return. Of course function returns 'false' all the time.
And I see in temporary session file that 'userid' variable is registered and contains appropriate value.
What the problem is ? I thought that $HTTP_SESSION_VARS[] array should contain session variables in any way.
Moreover in other functions I use $HTTP_SESSION_VARS[] and it works.
I can't explain it for myself.
PHP 4.0.4pl1, win32. But I also tried on another version of PHP4 on *nix platform - the same behaviour.
Thank you,
Leonid Asanov