Prelimary
use CGI;
use strict;
my $query = new CGI;
my $cookie;
...
sub writeCookie {
my($expires,$name,$contents,$rememberBoolean) = @_;
if($rememberBoolean) {
$expires = "+6M"; ## give them a 6 month remembered period
} else {
$expires = ""; ## delete the cookie after the browser has been closed
}
$cookie = $query->cookie(
-name=>$name,
-value=>$contents,
-expires->$expires
);
print $query->header(-cookie=>[$cookie]);
}
No comments:
Post a Comment