or download this
# Create a random session ID number:
my $sessionid = join "", map { int rand 100 } 1..20;
...
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);