#!/usr/bin/perl -w use strict; if ($ENV{'QUERY_STRING'} ne 'TESTING') { print "HTTP/1.0 302 Moved Temporarily\n"; print "Set-Cookie: Cookie=Test\n"; print "Location: $ENV{'SCRIPT_NAME'}?TESTING\n\n"; } else { if ($ENV{'HTTP_COOKIE'} =~ /Cookie=Test/) { print("Content-type: text/html\n\n"); print(""); print("$ENV{'HTTP_USER_AGENT'} supports Cookies"); print(""); print("Your browser, $ENV{'HTTP_USER_AGENT'}, supports the Netscape HTTP "); print("Cookie Specification."); print(""); } else { print("Content-type: text/html\n\n"); print(""); print("$ENV{'HTTP_USER_AGENT'} doesn't support Cookies"); print(""); print("Your browser, $ENV{'HTTP_USER_AGENT'}, doesn't appear to support cookies."); print("Cookie Specification."); print(""); } }