sub get_cookies {
# cookies are separated by a semicolon and a space, this will
# split them and return a hash of cookies
my @rawCookies = split /; /, $ENV{'HTTP_COOKIE'};
my %cookies;
foreach (@rawCookies){
my($key, $val) = split /=/, $_;
$cookies{$key} = $val;
}
return %cookies;
}