[Catalyst] noob question about session timeouts

Cliff Green green at umdnj.edu
Sun Nov 2 21:00:13 GMT 2008

When a session expires in the app I'm putting together, the user is sent 
back to the login screen at the next request, as expected.  What I'd 
like to do is stuff something like 'Session Expired' into 
$c->stash->{error_msg} and have it displayed, letting the user know what 
just happened.

I've tried things like
  unless ($c->session_expires) {
     $c->stash->{error_msg} = 'Session Expired!';

in, variously, Root.pm and Login.pm but of course it doesn't work.

Alternatively, it would be nice to know how to use something along the 
lines of
  $c->stash->{error_msg} = $c->session_delete_reason;
to do the same kind of thing.

I've only just started using Catalyst and I can see where this should be 
obvious;  any suggestions?



More information about the Catalyst mailing list