<div class="gmail_quote">On Tue, Jun 9, 2009 at 10:41 AM, Tomas Doran <span dir="ltr"><<a href="mailto:bobtfish@bobtfish.net">bobtfish@bobtfish.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Fayland Lam wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">
hey, it's a patch for Catalyst::Plugin::Session::Store::Cookie. to make cookie_domain more configurable.<br>
<br>
__PACKAGE__->config->{session}->{cookie_domain} = sub {<br>
my $c = shift;<br>
if ( $c->req->uri->host =~ /xxx\.com/ ) {<br></div>
return '.<a href="http://xxx.com" target="_blank">xxx.com</a> <<a href="http://xxx.com" target="_blank">http://xxx.com</a>>';<br>
} else {<br>
return '.<a href="http://yyy.com" target="_blank">yyy.com</a> <<a href="http://yyy.com" target="_blank">http://yyy.com</a>>';<div class="im"><br>
}<br>
};<br>
<br>
if it's acceptable, I'll provide a .t for that.<br>
</div></blockquote>
<br>
Er, I don't see the value of putting code refs into config - that's fairly insane.. Code != config.<br>
<br>
What are you actually trying to achieve here (i.e. what are some example use cases)?<br>
<br>
But yes, patches to improve flexibility with tests would be generally welcome.<br>
<br>
Cheers<br>
t0m<br>
<br>
<br>
</blockquote><div><br>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.<br><br>A simple, and contrived but real world example, is this:<br>
<br>Production application lives on <a href="http://secure.domainname.com">secure.domainname.com</a>, but shares auth cookies with <a href="http://www.domainname.com">www.domainname.com</a><br><br>As such, you set cookie_domain => '.<a href="http://domainname.com">domainname.com</a>'<br>
<br>However, in development without special modification (local config having cookie_domain => 'localhost') you can't login anymore.<br><br>Being able to specify the session cookie name based on the request would be useful for edge cases.<br>
<br>-J<br><br><br></div></div>