From: Tatsuhiko Miyagawa Date: Fri, 29 Jan 2010 01:46:00 +0000 (-0800) Subject: Make it work the new Plack::Request (in Plack 1.0) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FWeb-Session.git;a=commitdiff_plain;h=2c5f34e84f8afaef1d7335f81f8eafb5eb054ebf Make it work the new Plack::Request (in Plack 1.0) --- diff --git a/Makefile.PL b/Makefile.PL index b9cd75e..29ab832 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -7,7 +7,7 @@ all_from 'lib/Plack/Middleware/Session.pm'; license 'perl'; # prereqs -requires 'Plack' => '0.9028'; +requires 'Plack' => '0.99_01'; requires 'Plack::Request' => '0.09'; # for session ID gen diff --git a/lib/Plack/Session/State/Cookie.pm b/lib/Plack/Session/State/Cookie.pm index 2b33edb..1d6772f 100644 --- a/lib/Plack/Session/State/Cookie.pm +++ b/lib/Plack/Session/State/Cookie.pm @@ -18,12 +18,12 @@ use Plack::Util::Accessor qw[ sub get_session_id { my ($self, $env) = @_; - ( Plack::Request->new($env)->cookie( $self->session_key ) || return )->value; + Plack::Request->new($env)->cookies->{$self->session_key}; } sub expire_session_id { my ($self, $id, $res, $options) = @_; - $self->_set_cookie($id, $res, expires => 0); + $self->_set_cookie($id, $res, expires => time); } sub finalize {