"; session_destroy(); // The session associative array is still hanging around, // however, it is no longer attached to the session, // so we can just unset it. unset ($session); } else if ( $username ) { // The script was given a username, so let's create a session. $session['username'] = $username; // This line is to appease our Perl counterpart. $session['_session_id'] = session_id(); session_register('session'); } if ( $user = $session['username'] ) { // There is a session defined already. Let's say hi. print "Hello $user!
"; print "Logout"; } else { // This is the first time we accessed the script. // Print out a text box print "
"; print "What is your username? "; print "
"; } ?>