[Catalyst-dev] Re: Implementing a 'remember me on this
computer' button
Marcus Ramberg
marcus at nordaaker.com
Thu Apr 7 12:48:15 GMT 2011
Hey, sorry if this has already been mentioned, but what about http://search.cpan.org/~nuffin/Catalyst-Plugin-Session-DynamicExpiry-0.02/lib/Catalyst/Plugin/Session/DynamicExpiry.pm ?
Marcus Ramberg
Chief Yak Shaver
Nordaaker Consulting http://nordaaker.no/
On torsdag 7. april 2011 at 14.04, Edmund von der Burg wrote:
> On 4 April 2011 10:43, Edmund von der Burg <evdb at ecclestoad.co.uk> wrote:
> > It seems to me that the easiest way to implement this might be to add
> > a flag that can be saved to the session - 'browser_session_only' or
> > similar. This would then be checked by the
> > C::P::Session::State::Cookie code (for the individual session) and the
> > correct cookie expiry time set. Happy to provide patches/tests if this
> > is the way to go.
>
> It would appear that there was no good standard way to do this.
>
> Attached are patches for code and tests that add the following method
> to Catalyst::Plugin::Session::State::Cookie:
>
> set_session_cookie_expire $ttl_in_seconds
>
> $c->set_session_cookie_expire(3600); # set to 1 hour
> $c->set_session_cookie_expire(0); # expire with browser session
> $c->set_session_cookie_expire(undef); # fallback to default
>
> This lets you change the expiry for the current session’s cookie. You can set a
> number of seconds, 0 to expire the cookie when the browser quits or undef to
> fallback to the configured defaults. The value you choose is persisted.
>
> Note this value has no effect on the exipry in the session store - it only
> affects the cookie itself.
>
>
> The patch is against the latest from the repo:
>
> URL: http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Plugin-Session-State-Cookie/trunk
> Revision: 13996
>
>
> I hope that they can be applied soon - let me know if they need any changes :)
>
> Cheers,
> Edmund.
> _______________________________________________
> Catalyst-dev mailing list
> Catalyst-dev at lists.scsys.co.uk
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
>
> Attachments:
> - set_session_cookie_expire.diff
>
>
More information about the Catalyst-dev
mailing list