#!/usr/bin/perl # # setguid.pl - receive a GUID from GUID.org and set a site-specific cookie # # Usually used as a reponse to the GUID.org getguid routine, i.e.: # # # For more information, see http://www.guid.org/usage.html # $gifbits = "GIF89a\x01\x00\x01\x00\x80\xFF\x00\xC0\xC0\xC0\x00\x00\x00!\xF9\x04\x01\x00\x00\x00\x00,\x00\x00\x00\x00\x01\x00\x01\x00@\x02\x02D\x01\x00;"; if ($query=$ENV{"QUERY_STRING"}) { ($guid) = ($query =~ /GUID=([^&]*)/); print "Set-Cookie: GUID=$guid; Expires=Thu 31-Dec-37 23:59:59 GMT; Path=/\n" if ($guid); } print "Content-Type: image/gif\n\n"; print $gifbits;