[Catalyst] patch for C::P::Session::Store::Cookie

J. Shirley jshirley at gmail.com
Tue Jun 9 18:19:46 GMT 2009


On Tue, Jun 9, 2009 at 10:41 AM, Tomas Doran <bobtfish at bobtfish.net> wrote:

> Fayland Lam wrote:
>
>> hey, it's a patch for Catalyst::Plugin::Session::Store::Cookie. to make
>> cookie_domain more configurable.
>>
>>    __PACKAGE__->config->{session}->{cookie_domain} =3D sub {
>>        my $c =3D shift;
>>        if ( $c->req->uri->host =3D~ /xxx\.com/ ) {
>>            return '.xxx.com <http://xxx.com>';
>>        } else {
>>            return '.yyy.com <http://yyy.com>';
>>        }
>>    };
>>
>> if it's acceptable, I'll provide a .t for that.
>>
>
> Er, I don't see the value of putting code refs into config - that's fairly
> insane.. Code !=3D config.
>
> What are you actually trying to achieve here (i.e. what are some example
> use cases)?
>
> But yes, patches to improve flexibility with tests would be generally
> welcome.
>
> Cheers
> t0m
>
>
>
I can't speak to the method, but the desire is something I would like to
have.  If an application is accessible via different domains, it is nice to
be able to change the cookie name.

A simple, and contrived but real world example, is this:

Production application lives on secure.domainname.com, but shares auth
cookies with www.domainname.com

As such, you set cookie_domain =3D> '.domainname.com'

However, in development without special modification (local config having
cookie_domain =3D> 'localhost') you can't login anymore.

Being able to specify the session cookie name based on the request would be
useful for edge cases.

-J
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090609/52197=
7e9/attachment.htm


More information about the Catalyst mailing list