Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / cookies / resources / clearCookies.cgi
blob27896b7db28a25e2c34c2853ea4b0e201e64fd92
1 #!/usr/bin/perl -wT
2 use strict;
4 print "Content-Type: text/plain\n";
5 print "Cache-Control: no-store\n";
6 print 'Cache-Control: no-cache="set-cookie"' . "\n";
8 my $cookie = $ENV{"HTTP_CLEAR_COOKIE"};
10 if ($cookie =~ /Max-Age/i) {
11 $cookie =~ s/Max-Age *= *[0-9]+/Max-Age=0/i;
12 } else {
13 $cookie .= ";" unless ($cookie =~ m/;$/);
14 $cookie .= " " unless ($cookie =~ m/ $/);
15 $cookie .= "Max-Age=0";
18 if ($cookie =~ /Expires/i) {
19 # Set the "Expires" field to UNIX epoch
20 $cookie =~ s/Expires *= *[^;]+/Expires=Thu, 01 Jan 1970 00:00:00 GMT/i;
21 } else {
22 $cookie .= ";" unless ($cookie =~ m/;$/);
23 $cookie .= " " unless ($cookie =~ m/ $/);
24 $cookie .= "Expires=Thu, 01 Jan 1970 00:00:00 GMT";
27 print "Set-Cookie: $cookie\n\n";