Dancer icon indicating copy to clipboard operation
Dancer copied to clipboard

Dancer::Session - option to disable send of cookie on session read

Open lecar-red opened this issue 11 years ago • 3 comments

Need an option to disable sending of a cookie on session read, this would need to be added to both get and get_current_session.

This is causing module Dancer::Debug & Plack debug handler to throw error:

Too late to set another cookie, headers already built

lecar-red avatar Jan 14 '14 21:01 lecar-red

#988 merged. Thanks!

yanick avatar Feb 01 '14 18:02 yanick

Looks like #988 does not help. Sessions are still being sent to client in cookie Here is my code:

hook 'before' => sub {
    if(request->path_info =~ m{^/api}) {
        info "1 " . Dumper (Dancer::Cookies->cookies->{'today.session'});
        my $session = Dancer::Session->get_current_session(no_update => 1);
        info "2 " . Dumper (Dancer::Cookies->cookies->{'today.session'});
        return;
    }
    ...
}
[16397]  info @0.000381 05/Mar/2014 16:18:06> Starting service at Wed Mar  5 12:18:06 2014 [/home/ubuntu/today/dancer/bin/app.pl:8]
[16398]  info @0.003599 05/Mar/2014 16:18:18> 1 $VAR1 = undef; [/home/ubuntu/today/dancer/lib/Today.pm:30]
[16398]  info @0.018654 05/Mar/2014 16:18:18> 2 $VAR1 = bless( {
                 'domain' => undef,
                 'value' => [
                              '283045786842224453082967775958133537'
                            ],
                 'name' => 'today.session',
                 'secure' => undef,
                 'path' => '/',
                 'http_only' => 1,
                 'expires' => 'Thu, 05-Mar-2015 12:18:18 GMT'
               }, 'Dancer::Cookie' ); [/home/ubuntu/today/dancer/lib/Today.pm:32]

Dancer-1.3120

neptunix avatar Mar 05 '14 12:03 neptunix

neptunix: you'll need to upgrade to version: 1.3121

see: https://metacpan.org/changes/distribution/Dancer

lecar-red avatar Mar 23 '14 19:03 lecar-red