Trying to figure our how to create, store and retrieve session info in Catalyst. Any suggestions?
Thanks Fayland. I wasn't aware that there was a flash() method that persists values until they're read. Will give it a try.
freakwincy
2009-11-05 13:34:57
+4
A:
You need only to add the relevant session plugins to your use Catalyst
line, ie:
use Catalyst qw/
-Debug
...
Session
Session::Store::FastMmap
Session::State::Cookie
/;
... and then you can refer to $c->session->{key}
from there. There are some configurables about cookie age and so on, but the defaults are sane. That should get you started.
(Of course, you may need to install those Session-related modules from CPAN, if they're not available to you already.)
RET
2009-11-05 07:38:21