Page 1 of 1

$_SESSION not working in 4.2.3 on MS Win2000

Posted: Mon Nov 18, 2002 5:50 pm
by goldparrot
I am having serious troubles with using Sessions in 4.2.3 on MS Win 2000.

Is anyone else having any of the following problems?

1) When using $__SESSION, the session handling just plain doesn't work.
or
2) Same exact code written using $__SESSION works if I replace $__SESSION with $HTTP_SESSION_VARS

and
3) If I try to encapsulate the session code in a function, "wrapping it in my own class", the $HTTP_SESSION_VARS superglobal doesn't seem to be global. When I leave the function, the variable set no longer appears in $HTTP_SESSION_VARS.

Give me a shout at email bmichael@goldparrot.com if you have come across these.

Posted: Tue Nov 19, 2002 6:32 am
by twigletmac
In what you've posted above you've used two underscores in $_SESSION instead of just one, so you need $_SESSION instead of $__SESSION. It could just be a typo in the post but may explain why the array doesn't appear to be working as expected.

It is also important to note that $HTTP_SESSION_VARS is not a autoglobal and has to be declared global in any function in which it is used:

Code: Select all

function myfunction($arg1, $arg2)
{
    global $HTTP_SESSION_VARS;
    /* Lots of code */
}
Mac

Posted: Tue Nov 19, 2002 4:25 pm
by hedge
I am running that exact setup without any problems. Have you checked the file security?