Mailing List Archive

Session module
Hello,

This is proposal for a new module, similar to
Catalyst::Plugin::Session::DynamicExpiry.

The difference is, that my module can handle cookie expiring, but not only
session. It's necessary for implementing features like "remember me"
checkboxes fully.

It's not seemed necessary to inherit the basic module, cause it's rather
simple and I think 'all-in-one' solution is more convenient.

What do you think about all this?


--
Kind Regards, Eugeny.
Session module [ In reply to ]
Hello,

This is proposal for a new module, similar to
Catalyst::Plugin::Session::DynamicExpiry.

The difference is, that my module can handle cookie expiring, but not only
session. It's necessary for implementing features like "remember me"
checkboxes fully.

It's not seemed necessary to inherit the basic module, cause it's rather
simple and I think 'all-in-one' solution is more convenient.

What do you think about all this?


--
Kind Regards, Eugeny.
Re: Session module [ In reply to ]
On Mon, Oct 20, 2008 at 03:49:40PM +0400, jackal wrote:
> Hello,
>
> This is proposal for a new module, similar to
> Catalyst::Plugin::Session::DynamicExpiry.
>
> The difference is, that my module can handle cookie expiring, but not only
> session. It's necessary for implementing features like "remember me"
> checkboxes fully.
>
> It's not seemed necessary to inherit the basic module, cause it's rather
> simple and I think 'all-in-one' solution is more convenient.

Only for new code. Not for people trying to update existing code who already
rely on the current store and state plugins.

Try again.

--
Matt S Trout Need help with your Catalyst or DBIx::Class project?
Technical Director http://www.shadowcat.co.uk/catalyst/
Shadowcat Systems Ltd. Want a managed development or deployment platform?
http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/

_______________________________________________
Catalyst-dev mailing list
Catalyst-dev@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
Re: Session module [ In reply to ]
On Thursday 13 November 2008 00:15:58 Matt S Trout wrote:
> On Mon, Oct 20, 2008 at 03:49:40PM +0400, jackal wrote:
> > Hello,
> >
> > This is proposal for a new module, similar to
> > Catalyst::Plugin::Session::DynamicExpiry.
> >
> > The difference is, that my module can handle cookie expiring, but not
> > only session. It's necessary for implementing features like "remember me"
> > checkboxes fully.
> >
> > It's not seemed necessary to inherit the basic module, cause it's rather
> > simple and I think 'all-in-one' solution is more convenient.
>
> Only for new code. Not for people trying to update existing code who
> already rely on the current store and state plugins.
>
> Try again.

I don't know any existing code which can handle cookie expiring.
So I can add a compatibility shim like this:

sub session_time_to_live {
my ( $c, $ttl ) = @_;
if (defined $ttl) {
$c->session_cookie_ttl($ttl);
$c->session_ttl($ttl) if $ttl > 0; # maybe 'session' cookie w/o expiry
}
# Choose a smaller value if there's not a 'session' cookie
my ($st, $ct) = ($c->session_ttl, $c->cookie_ttl);
return ( ($ct < $st) && ($ct > 0) ) ? $ct : $st;
}

It implements DynamicExpiry's public method and handle cookie expiring
automatically, based on session expiring.


--
Kind regards, Eugeny.

_______________________________________________
Catalyst-dev mailing list
Catalyst-dev@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev