X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Plugin-Session-State-Cookie.git;a=blobdiff_plain;f=FastMmap.pm;h=479b2881600973a86055e429e4f2cbdcd8d81f6c;hp=b367f3a046242933466e7518e6684c334e2fac66;hb=5eccd0086a4649789d8210c050e34d041cbc3115;hpb=b2f8df5e44849b00365888e61ce49d8e8c9ef234 diff --git a/FastMmap.pm b/FastMmap.pm index b367f3a..479b288 100644 --- a/FastMmap.pm +++ b/FastMmap.pm @@ -9,7 +9,7 @@ use URI; use URI::Find; use File::Temp 'tempdir'; -our $VERSION = '0.07'; +our $VERSION = '0.11'; __PACKAGE__->mk_classdata('_session'); __PACKAGE__->mk_accessors('sessionid'); @@ -53,7 +53,12 @@ sub finalize { if ( my $cookie = $c->request->cookies->{session} ) { $set = 0 if $cookie->value eq $sid; } - $c->response->cookies->{session} = { value => $sid } if $set; + if ( $set ) { + $c->response->cookies->{session} = { + value => $sid, + expires => $c->config->{session}->{expires} . 's' + }; + } if ( $c->config->{session}->{rewrite} ) { my $finder = URI::Find->new( sub { @@ -64,7 +69,7 @@ sub finalize { return $c->uri($orig); } ); - $finder->find( \$c->res->{output} ) if $c->res->output; + $finder->find( \$c->res->{body} ) if $c->res->body; } } return $c->NEXT::finalize(@_); @@ -177,8 +182,8 @@ Marcus Ramberg C =head1 COPYRIGHT -This program is free software, you can redistribute it and/or modify it under -the same terms as Perl itself. +This program is free software, you can redistribute it and/or modify it +under the same terms as Perl itself. =cut