Skip to content

Commit

Permalink
Add utility function cookies_hash to return all current cookies as a …
Browse files Browse the repository at this point in the history
…hashref
  • Loading branch information
David Christensen committed Jun 18, 2011
1 parent e28246e commit 78543c5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/Vend/Util.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2010,6 +2010,15 @@ sub read_cookie {
return unescape_chars($1);
}

sub cookies_hash {
my $string = shift || $CGI::cookie;
my %cookies = map {
my ($k,$v) = split '=', $_, 2;
$k => unescape_chars($v)
} split(/;\s*/, $string);
return \%cookies;
}

sub send_mail {
my($to, $subject, $body, $reply, $use_mime, @extra_headers) = @_;

Expand Down

0 comments on commit 78543c5

Please sign in to comment.