views:

195

answers:

2

Trying to figure our how to create, store and retrieve session info in Catalyst. Any suggestions?

+3  A: 

See Catalyst::Manual::Tutorial::05_Authentication.

Fayland Lam
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
+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
Thanks RET, much appreciated.
freakwincy