Fixed so that session_expires == stored session expires
[catagits/Catalyst-Plugin-Session.git] / t / lib / SessionExpiry / Controller / Root.pm
CommitLineData
079b2fbe 1package SessionExpiry::Controller::Root;
2use strict;
3use warnings;
4
5use base qw/Catalyst::Controller/;
6
7__PACKAGE__->config( namespace => '' );
8
9sub session_data_expires : Global {
10 my ( $self, $c ) = @_;
11 $c->session;
12 if (my $sid = $c->sessionid) {
13 $c->finalize_headers(); # force expiration to be updated
14 $c->res->output($c->get_session_data("expires:$sid"));
15 }
16}
17
18sub session_expires : Global {
19 my ($self, $c) = @_;
20 $c->session;
21 $c->res->output($c->session_expires);
22}