# cookie.pl

sub decode_cookie {

   local($cookie) = @_;
   local($name,$value,$cookies);

   foreach (split(/\;/,$ENV{'HTTP_COOKIE'}))
   {
      ($name, $value) = split(/=/);
      $name =~ s/ //g;
      $COOKIES{$name} = $value;
   }

   foreach (split(/\,/,$COOKIES{$cookie}))
   {
      ($name, $value) = split(/:/);
      $COOKIE{$name} = $value;
   }
}

1;
