<div class="gmail_quote">On Tue, Jun 9, 2009 at 10:41 AM, Tomas Doran <span dir="ltr">&lt;<a href="mailto:bobtfish@bobtfish.net">bobtfish@bobtfish.net</a>&gt;</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&#39;s a patch for Catalyst::Plugin::Session::Store::Cookie. to make cookie_domain more configurable.<br>
<br>
    __PACKAGE__-&gt;config-&gt;{session}-&gt;{cookie_domain} = sub {<br>
        my $c = shift;<br>
        if ( $c-&gt;req-&gt;uri-&gt;host =~ /xxx\.com/ ) {<br></div>
            return &#39;.<a href="http://xxx.com" target="_blank">xxx.com</a> &lt;<a href="http://xxx.com" target="_blank">http://xxx.com</a>&gt;&#39;;<br>
        } else {<br>
            return &#39;.<a href="http://yyy.com" target="_blank">yyy.com</a> &lt;<a href="http://yyy.com" target="_blank">http://yyy.com</a>&gt;&#39;;<div class="im"><br>
        }<br>
    };<br>
<br>
if it&#39;s acceptable, I&#39;ll provide a .t for that.<br>
</div></blockquote>
<br>
Er, I don&#39;t see the value of putting code refs into config - that&#39;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&#39;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 =&gt; &#39;.<a href="http://domainname.com">domainname.com</a>&#39;<br>
<br>However, in development without special modification (local config having cookie_domain =&gt; &#39;localhost&#39;) you can&#39;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>