Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Dev

Session module

 

 

Catalyst dev RSS feed   Index | Next | Previous | View Threaded


me at jackal

Oct 20, 2008, 4:49 AM

Post #1 of 4 (942 views)
Permalink
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.
Attachments: ExpireControl.pm.gz (1.64 KB)


me at jackal

Oct 21, 2008, 4:13 AM

Post #2 of 4 (869 views)
Permalink
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.
Attachments: ExpireControl.pm.gz (1.64 KB)


dbix-class at trout

Nov 12, 2008, 1:15 PM

Post #3 of 4 (791 views)
Permalink
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[at]lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev


me at jackal

Nov 20, 2008, 2:14 AM

Post #4 of 4 (744 views)
Permalink
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[at]lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev

Catalyst dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.