use URI::Find;
use File::Temp 'tempdir';
-our $VERSION = '0.07';
+our $VERSION = '0.10';
__PACKAGE__->mk_classdata('_session');
__PACKAGE__->mk_accessors('sessionid');
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 {
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(@_);