[Dancer-users] Cookies handling is broken

Marco Fontani mfontani at cpan.org
Mon Feb 28 12:42:54 CET 2011


> To do so he uses multiple cookies to flag each visitors, and he came to
> realize that Dancer's cookie handling is ... well, completely broken :/

I did have a similar problem in my Brocco[1] blog engine, and so far
I've "fixed" it in my app(s) with the following ugly workaround:

## Fix cookies
before sub {
    my $c = cookies;
    delete $c->{$_} for grep $_ ne 'dancer.session', keys %$c;
};

I am aware the above is not a fix _for Dancer_, but it allows
_applications_ which may "receive" tracking cookies to _work_ if they
use a Dancer::Session::* and they only care about the "dancer.session"
cookie.

If the app needs to use more than one cookie, the above does not seem
to be a solution, unfortunately.

-marco-

[1]: https://github.com/mfontani/Brocco

----
Marco Fontani
Glasgow Perl Mongers - http://glasgow.pm.org/
Join the RackSpace Cloud at: http://www.rackspacecloud.com/277.html


More information about the Dancer-users mailing list