sub set_cookie { ########################################### # Create a cookie. We have a few different # "states" and all of them require at least # *some* user information # Uses a global CGI object ($p) to create # the cookie ########################################### # Get the passed user information my %ui = @_; # set the params for the cookie my $cookie = $p->cookie( -name => 'mycookie', -value => qq(Name:$ui{'Name'}:Phone:$ui{'Phone'}:EmployeeNum:$ui{'EmployeeNum'}:Email:$ui{'Email'}:SapId:$ui{'SapId'}:NTID:$ui{'NTID'}:Province:$ui{'Province'}), -expire => '', ); # send it to the browser print $p->header(-cookie => $cookie); }