Still trying to understand sessions?

From: Date: Wed, 23 Apr 2003 19:09:06 +0000
Subject: Still trying to understand sessions?
Groups: php.general 
Request: Send a blank email to php-general+get-145082@lists.php.net to get a copy of this message
I am a little confused about $_SESSION['whatever'], session_register("whatever");, or $HTTP_SESSION_VARS["whatever"]. Right now I have a script that uses the following: if (!session_is_registered("formsave")) { // Form Array session_register("formsave"); } foreach($HTTP_POST_VARS as $varname => $value) $formsave[$varname] = trim($value); I understand that this is assigning all the variables from my form to an array called $formsave. I can then use it something like - echo $formsave["username']; or whatever else I may need it for - but how do I do the same thing with $_SESSION. I have downloaded a couple of other scripts that use $_SESSION, but I want to convert one or the other so that my scripts are standardized. Any help in explaining these differences is appreciated. TIA

« previous php.general (#145082) next »