[Catalyst] Re: Persistent login
Evaldas Imbrasas
evaldas at imbrasas.com
Wed May 16 02:47:21 GMT 2007
On 5/15/07, Jonathan Rockway <jon at jrock.us> wrote:
> Use the session plugin and set the session expiration to ... 1 week. If some
> data needs to expire sooner than that ... expire it sooner than that.
>
> Here's what I would do. Create a session and log the user in. Store a "last
> login" time in the user_class. If the last_login (or last_activity;
> whatever) is too long ago, delete data from the session and start over.
Yep, makes sense. However, even in that case, I was hoping that the
standard session/auth plugins would support this functionality without
doing anything additional in my Controller::Auth, i.e.:
if ($c->req->params->{login_remember}) {
$c->login($email, $password, $expires_long);
} else {
$c->login($email, $password, $expires_short);
}
Am I wrong in thinking that pretty much any decent login system has to
support this anyway?.. (This is my first Catalyst project, so I
wouldn't be surprised if there's a one-liner out there that would
solve this problem without a need for the above - sorry if that's the
case.)
--
-----------------------------------------------------
Evaldas Imbrasas
http://www.imbrasas.com
More information about the Catalyst
mailing list