4 use POSIX qw(strftime);
7 $ENV{"HTTP_COOKIES"} = "";
8 my %param = readparse();
10 my $clear = (defined $param{"clear"} && $param{"clear"} eq "yes");
11 my @time_now = gmtime(time());
12 my $time_future = strftime("%a, %d-%b-%Y %T GMT",
13 59, 59, 23, 31, 11, $time_now[5]+10);
14 my $time_past = strftime("%a, %d-%b-%Y %T GMT",
15 59, 59, 23, 31, 11, $time_now[5]-10);
17 my @cookie_options = qw(repeatmerged terse reverse trim);
19 print "Content-Type: text/html; charset=utf-8\n";
21 for my $c (@cookie_options) {
22 if (defined $param{$c}) {
23 printf "Set-Cookie: %s=%s; expires=%s; domain=%s; path=/\n",
24 $c, $param{$c}, $time_future, "bugs.debian.org";
26 printf "Set-Cookie: %s=%s; expires=%s; domain=%s; path=/\n",
27 $c, "", $time_past, "bugs.debian.org";
31 print "<p>Cookies set!\n";
32 for my $c (@cookie_options) {
33 if (defined $param{$c}) {
34 printf "<br>Set %s=%s\n", $c, $param{$c};
36 printf "<br>Cleared %s\n", $c;
38 printf "<br>Didn't touch %s (use clear=yes to clear)\n", $c;