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
etc.).

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/

_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to