#!/usr/bin/perl # A Simple cookie test to indicate if the clients browser supports cookies. # Distributed through Cookie Central. http://www.cookiecentral.com. # $myLoc = 'http://www.your-server.com/cgi-bin/ct.cgi?TEST'; if($ENV{'QUERY_STRING'} eq 'TEST') { if($ENV{'HTTP_COOKIE'} =~ /Cookie=Test/) { $reply = "Good Cookie!Your browser supports the Netscape HTTP Cookie Specification as set by including a Set-Cookie HTTP Header!"; } else { $reply = "Bad CookieSorry, Your browser doesn't appear to support the cookie protocol. If you believe you have gotten this message in error... Don't eat cookies"; } print $reply; } else { print "HTTP/1.0 302 Moved Temporarily\n\r Location: $myLoc\n\rSet-Cookie: Cookie=Test\n\r\n\r BYE-BYE"; }