Skip to content

Commit

Permalink
Ensure cookie variable is accessible
Browse files Browse the repository at this point in the history
  • Loading branch information
rwstauner committed Aug 13, 2014
1 parent 618ace7 commit 9e0e21a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app.psgi
Expand Up @@ -83,9 +83,12 @@ my $app = Plack::App::URLMap->new;
},
deserializer => sub {

# We can't reference $_[0] from inside the try block.
my $cookie = $_[0];

# Use try/catch so JSON doesn't barf if the cookie is bad.
try {
JSON::decode_json( MIME::Base64::decode( $_[0] ) );
JSON::decode_json( MIME::Base64::decode($cookie) );
}

# No session.
Expand Down

0 comments on commit 9e0e21a

Please sign in to comment.