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.
$_SESSION not working in 4.2.3 on MS Win2000
Moderator: General Moderators
-
goldparrot
- Forum Newbie
- Posts: 1
- Joined: Mon Nov 18, 2002 5:50 pm
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
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:
Mac
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 */
}