You don't *have* to use $_SESSION or $HTTP_SESSION_VARS but its a good idea if you do. What Moharo is getting at is PHP used to have a register globals functionality that made all variables from all sources available in global context without referring to its respective method. As of one of the version 4 point upgrades this functionality was deprecated and consequently was turned off by default in the php.ini file. So many of the text books that came out at the time that used global variables in their scripts became outdated. This was decided for security reasons by the PHP group. Now in order to use a variable that is not defined exclusively within the running of a script, like post or session data must be accessed by special variable arrays. You can turn the register_globals back on in php.ini by modifying the line to register_globals=On.
What's good about $_SESSION, $_POST, $_COOKIE, $_GET, $_REQUEST, $_SERVER etc. Is these are super-global variables. Which means that they can be accessed within any variable scope. Inside of functions, classes, etc. The super-globals with an underscore in front are the only available in this scope, the old names like $HTTP_SESSION_VARS are only available in regular variable scope. Meaning you would have to pass these to a function in order for them to be available within a function.
I hope that elaborates on why you were getting the behavior you were getting. I also noticed some syntax errors in your script. Your left off a dollar sign in a the $PHPSESSID variable.
Theres more information on variable scope at php.net.
http://www.php.net/manual/en/language.variables.php
hth,
: )
Rich
:::::::::::::::::::::::::::::::::
Smiling Souls
http://www.smilingsouls.net
:::::::::::::::::::::::::::::::::