On Monday 16 April 2007 18:55, Bernhard Graf wrote:

The code I posted yesterday doesn't work. NEXT::finalize_cookies() has
to be called at the end.
Here is a fixed version, that also doesn't alter the cookie domain if
it's already set:


sub finalize_cookies {
    my $c = shift;

    my $sc = $c->response->cookies->{$c->config->{session}->{cookie_name}};

    if (defined($sc) and ref($sc) eq 'HASH') {
        $sc->{domain} ||= (/(\.[^\.]+\.[^\.]+)$/)[0] || $_ for 
$c->request->uri->host;
    }
    $c->NEXT::finalize_cookies(@_);
}

-- 
Bernhard Graf

_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to