## step 1. take the username and password from the form ## step 2. query the mysql db and check to see whether the password is good for the username ## Now create session id and set cookies ..... $cgi = new CGI; $session = new CGI::Session("driver:DB_File",undef,{Directory=>'/tmp'}); $sid=$session->id(); $session->param("userid",$newuserid); $cookie=$cgi->cookie(CGISESSID=>$session->id); print $cgi->header(-cookie=>$cookie); $cookieuserid=$session->param("userid"); ## now we can display anything to them because they just logged in