Page 2 of 2

Posted: Tue Sep 10, 2002 10:01 am
by twigletmac
waskelton4 wrote:also.. to clarify what just happened....

Code: Select all

<?php 
session_start(); 
session_register('test'); 
session_register('test2'); 

$test = 1; 
$test2 = 'foo'; 
?>
this code creates two variables $test and $test2 and puts them in an array called $HTTP_SESSION_VARS....

correct?
Pretty much - session_register() registers the named variables (whether they exist at the time of registration or not) as a session variable so by virtue of that they end up in the $HTTP_SESSION_VARS array. If you do the session_register() stuff at the top of the page then it's easier to remember what you have put in $HTTP_SESSION_VARS.

Mac

Posted: Tue Sep 10, 2002 10:03 am
by waskelton4
thanks again man...

Posted: Tue Sep 10, 2002 10:05 am
by twigletmac
S'alright :). Glad it's sorted, problems like that can be really miserable to deal with when absolutely nothing seems to work.

Mac

Posted: Tue Sep 10, 2002 10:45 am
by jason
I hate session_register().

Give me $_SESSION, or give me death!