[Catalyst] Session cookie and permanent state
fayland
fayland at gmail.com
Sat Sep 23 06:15:48 CEST 2006
hey, we have one function in our login interface like "remember me?"
guess it's very common.
I have some code as follows:
------------------
if ($c->login($username, $password) {
# make cookie expire
if ($c->req->param('permanent')) {
$c->session_expire_key( __user => 1000000000000 );
$c->update_session_cookie( $c->make_session_cookie(
$c->sessionid, expires => 1000000000000 ) ); # forever
} else {
$c->update_session_cookie( $c->make_session_cookie(
$c->sessionid, expires => 0 ) );
}
}
-------------------
I bet there is something wrong. anyone can give me a hand?
Thanks.
--
Fayland Lam // http://www.fayland.org/
More information about the Catalyst
mailing list