Added tests for expiry threshold
[catagits/Catalyst-Plugin-Session.git] / t / lib / SessionTestApp / Controller / Root.pm
index a6d86d1..9a38bc8 100644 (file)
@@ -127,4 +127,19 @@ sub change_session_expires : Global {
     $c->res->output($c->session_expires);
 }
 
+sub reset_session_expires : Global {
+    my ($self, $c) = @_;
+    $c->reset_session_expires;
+    $c->res->output($c->session_expires);
+}
+
+sub get_expires : Global {
+    my ( $self, $c ) = @_;
+    $c->session;
+    if (my $sid = $c->sessionid) {
+        $c->finalize_headers(); # force expiration to be updated
+        $c->res->output($c->get_session_data("expires:$sid"));
+    }
+}
+
 1;