derek -
Joined: 10 Oct 2003 Posts: 14
|
Posted: Sun Dec 28, 2003 3:47 am Post subject: WHY isn't my freaking cookie being set?!!?!?! :-( |
|
|
here is my code for setting a cookie...WHY is it not being set? i have done exactly what all the tutorials i find say to do...please help me someone!
CODE:
sub doCookieSet
{
$u="$FORM{'user'}";
$p="$FORM{'password'}";
use Digest::MD5 qw(md5_hex);
$md5pwd=md5_hex($p);
$finalcookie="user=$u;pass=$md5pwd";
use CGI;
$q=new CGI;
$cookie=$q->cookie(-name=>'derek',
-value=>$finalcookie
-expires=>'+3m');
print $q->header(-cookie=>$cookie);
&doCookieReturn;
}
#----------------------------------------------------------------------
sub doCookieReturn
{
use CGI;
$q=new CGI;
$thecookie=$q->cookie("derek");
if ($thecookie){print "$thecookie";}
else{print "Cookie does not exist";}
} |
|