maybe a basic explaination will help
err maybe a long rambling explaination will help
the session information is stored on your server.... it is given an id a session_id
when a use enters your site... a session is created for them.... stored in a file by default on the server... and something like a ticket needs to be left behind for the user to claim that session on next page click....
there are two ways to do this....
one: leave a cookie on the users site.... ok if they will let you... each page load, php (behind the scenes) retrieves this ticket from the cookie... finds the file that matches... and loads it for your itchy fingers to use....
two: if the user will not accept any cookies... you need some other way...
ok so you attach to every link on your site a
?PHP_SESS_ID=XXXXXX
and put a
<input type="hidden" name="PHP_SESS_ID" value="XXXXX">
inside every form so that every link clicked on and every form submitted will 'remember' who last was there...
ok all well and good but thats a lot of work... so ok... php decided to do this for you...all you have to do is tell php it is allowed to and it makes this happen.. just behind the scenes so you don't have to worry about it
you do this through the two mechanisms shown by the amazing IWS
either tell php youself with session_start()
or save yourself some carpel tunnel by letting php do it automatically without being asked by setting session_autostart in php.ini
when this happens php will set up a space for your session information
with register_globals off this is the $_SESSION array with register_globals on this is the $HTTP_SESSION_VARS array
now you just use it and behind the scenes php takes care of where to put this infromation between page loads... and takes care of managing who has what ticket to what session file...
now after reading tutorials and using the print_r() mentioned by IWS and reading my explaination... does it all make sense yet?