tidying up
[catagits/Catalyst-Plugin-Session-State-Cookie.git] / FastMmap.pm
index b367f3a..99cf679 100644 (file)
@@ -9,7 +9,7 @@ use URI;
 use URI::Find;
 use File::Temp 'tempdir';
 
-our $VERSION = '0.07';
+our $VERSION = '0.10';
 
 __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}
+            };
+        }
         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<mramberg@cpan.org>
 
 =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