# 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);