i am writing a login script in a perl and i set a cookie. here it is:
if ($V::testsubmit eq 'yes') {
($userid)=$dbh->selectrow_array("SELECT id from logins WHERE username='$V::username' and password='$V::password'");
}
if ($userid > 0){
@alphanumeric = ('a'..'z', 'A'..'Z', 0..9);
$sessionid = join '', map $alphanumeric[rand @alphanumeric], 0..50;
print<<"EOF";
<script language="JavaScript">
document.cookie = 'sessionid=$sessionid';
</script>
EOF
$dbh->do("UPDATE logins set session_id='$sessionid',last=NOW() WHERE id='$userid'");
$V::goto="home";
}else{
$message="You have entered and incorrect Login and/or Password";
$V::goto="login";
}}
}
now how would i check if the cookie is set later on in the script, and if it is, output it?