[Catalyst] noob question about session timeouts

Matt S Trout dbix-class at trout.me.uk
Sat Nov 15 16:17:34 GMT 2008

On Sun, Nov 02, 2008 at 10:20:08PM +0000, Peter Flanigan wrote:
> Cliff Green wrote:
> >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.
> Read up on Catalyst::Plugin::Session::flash

No, don't. We stole that from rails because it seemed like a good idea at
the time.

It isn't. It's evil, horrible, inefficient, and if you think you wanted it,
you didn't (multi tab issues, refresh issues, race conditions, dead kittens

If you really want transient data of that ilk, stuff it in $c->cache under
a key starting with the session id.

... if I write up an outline of how you'd generalise that, anybody fancy
having a go at hacking it together?

      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/

More information about the Catalyst mailing list