programming-examples/perl/CGI/Setting Cookie Expiration Using the CGI Module.pl
2019-11-15 12:59:38 +01:00

13 lines
265 B
Perl

#!/usr/bin/perl -T
use strict;
use CGI qw/:standard/;
my $cookie = cookie(-name=>'testcookie',value=>'testcookievalue',-expires=>'+7d');
print header (-cookie=>$cookie),
start_html('CGI Cookie Test'),
p("You've received a cookie\n"),
end_html;
exit;