Skip to content

Storable deserealization fail should cause 500 #20

@hmepas

Description

@hmepas

If you move your code from old server with 32bit arch and old Storable to a new one, and an old client comes in with old cookie it'll cause Storable::thaw to die on that data. Aint good behavior for a site to throw out 500 like this.

Here is the quick patch i propose at the line 24:

package Plack::Middleware::Session::Cookie;
...
    $self->deserializer(sub {
        my $result;
        eval {
            $result = Storable::thaw(MIME::Base64::decode($_[0]))
        };
        return if $@;
        return $result;
    }) unless $self->deserializer;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions