sub setcookie {    my($ky,$vl,$expires,$domain,$path) = @_;    my @days = ("Sun","Mon","Tue","Wed","Thu","Fri","Sat");    my @months = ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");    $expires=1800000000 if (! defined $expires); #15.1.2027    $expires=1800000000 if ($expires<0);    $domain = $ENV{'SERVER_NAME'} if (! defined $domain);    $path = "/" if (! defined $path);    if ($expires==0) {        $expires='';    } else {        my($seconds,$min,$hour,$mday,$mon,$year,$wday) = gmtime($expires);        $seconds = "0" . $seconds if ($seconds < 10);        $min = "0" . $min if ($min < 10);        $hour = "0" . $hour if ($hour < 10);        $year += 1900;        $expires = "expires=$days[$wday], $mday-$months[$mon]-$year $hour:$min:$seconds GMT; ";    }    $vl =~ s/ /+/g;    print "Set-Cookie: $ky=$vl; $expires path=$path; domain=$domain;\n"; }