Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Open
lecar-red opened this Issue · 3 comments

3 participants

@lecar-red

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

@yanick
Owner

#988 merged. Thanks!

@neptunix

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

@lecar-red

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.