1
2
3
4
5
6
7
8
9
10
11
my $cgi = CGI->new();
my $cookie1 = $cgi->cookie(-name=> 'autoname',
-value=> $meinWert1,
-expires => '+1y',
);
my $cookie2 = $cgi->cookie(-name=> 'autopin',
-value=> $meinWert2,
-expires => '+1y',
);
print $cgi->header(-cookie => [$cookie1, $cookie2]);
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#!/usr/bin/perl use strict; use warnings; my $meinWert1 = '04711'; my $meinWert2 = '42 THE VALUE OF THE WEB!'; use CGI; my $cgi = CGI->new(); my $cookie1 = $cgi->cookie(-name=> 'autoname', -value=> $meinWert1, -expires => '+1y', ); my $cookie2 = $cgi->cookie(-name=> 'autopin', -value=> $meinWert2, -expires => '+1y', ); print $cgi->header(-cookie => [$cookie1, $cookie2]);
1
2
3
4
Set-Cookie: autoname=04711; path=/; expires=Thu, 24-Dec-2015 14:27:25 GMT
Set-Cookie: autopin=42%20THE%20VALUE%20OF%20THE%20WEB%21; path=/; expires=Thu, 24-Dec-2015 14:27:25 GMT
Date: Wed, 24 Dec 2014 14:27:25 GMT
Content-Type: text/html; charset=ISO-8859-1