Skip to content

Instantly share code, notes, and snippets.

@bigpresh
Created February 15, 2011 23:31
Show Gist options
  • Save bigpresh/828519 to your computer and use it in GitHub Desktop.
Save bigpresh/828519 to your computer and use it in GitHub Desktop.
Supporting comma-separated cookies...
diff --git a/lib/Dancer/Cookies.pm b/lib/Dancer/Cookies.pm
index 15735fe..dd4992d 100644
--- a/lib/Dancer/Cookies.pm
+++ b/lib/Dancer/Cookies.pm
@@ -23,7 +23,7 @@ sub parse_cookie_from_env {
return {} unless defined $env_str;
my $cookies = {};
- foreach my $cookie ( split( '; ', $env_str ) ) {
+ foreach my $cookie ( split( /[,;]\s/, $env_str ) ) {
my ( $name, $value ) = split( '=', $cookie );
my @values;
if ( $value ne '' ) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment