>I'm trying to get the one variable I stored insite a session, the >variable's name is $username I am trying to do it like this, but I think >it's wrong: > >$PHPSESSID = session_encode(); >$username = session_decode(); > >It tells me I have wrong parameters for session decode. > >What am I supposed to encode to get the variable from the session?
The encode/decode is all taken care of *UNLESS* you are replacing PHP's session back-end with your own. <?php session_start(); if (isset($_SESSION['count'])){ echo "You have been here ", $_SESSION['count'], " times.<BR>\n"; } else{ $_SESSION['_count'] = 1; } echo "<A HREF=", $_ENV['PHP_SELF'], "?microsoftsucks=", mt_rand(), ">Come back soon</A><BR>\n"; ?> You only need the encode/decode stuff if you want to, say, take PHP's file-based session storage and move it to MySQL so that you can have *TWO* web-servers "talking" to the same database server and using the same storage system so that users can be on either web-server and have the same session data. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php