The session ID and data are managed directly by PHP, according to the settings in the php.ini file. PHP can store the data lots of different ways. All you have to do is start a session, and PHP will manage all the numbers internally, for every page view.
As if registered globals wasn't enough indication, PHP sessions are just a bit too automatic for their own good, so read the manual carefully before going down this bumpy road.
PHP SessionsPHP Session functionsThere are a few notable problems:
Only one session may be open at a time per member, so if you use frames, you're asking for trouble. "session_write_close()" exists to ease the pain.
Only one database connection per session.
Redirects do not re-transmit session data. You have to include the session ID in the redirect URL using "session_id()", or simply the constant "SID", which is defined when a session has been opened.
Also note that you can't really tell if a session is valid or not unless you test a variable with "isset($_SESSION['blah'])". The function "session_start()" returns TRUE no matter what. PHP's support for sessions changes all the time, so, like JavaScript, it's a good idea to test that things are valid before you use them, even though almost everything is server-side.