# Create a random session ID number: my $sessionid = join "", map { int rand 100 } 1..20; # Send the session id to the browser: print "Content-type: text/html\nSet-Cookie: session=$sessionid\n\n"; # And remember on the server which session that is: storesessioninfo($sessionid, $username, %other_session_info); #### if ($ENV{HTTP_COOKIE} =~ /sessionid=(\w+)/) { # Call the routine that reads the server-side session info: ($username, %other_session_info) = getsessioninfo($1); }