in reply to Re^3: Dancer Cookies
in thread Dancer Cookies

I get an uninitialized value error.

Replies are listed 'Best First'.
Re^5: Dancer Cookies (redirect instead of forward)
by Anonymous Monk on Nov 13, 2013 at 08:00 UTC

    I get an uninitialized value error.

    lwp-request outputs unitialized value error? That doesn't seem likely

    I've had a chance to run your dancer code, aside from the typos, the problem seems that you're using an internal redirect (forward), and that doesn't set cookies (makes sense to me)

    you want to do a proper http redirect, external redirect, use redirect instead of forward

    dancer -a dncook ....

    package dncook; use Dancer ':syntax'; our $VERSION = '0.1'; get '/' => sub { template 'index'; }; any ['get', 'post'] => '/viewscript' => sub { set_cookie name => 'return_page', value => '/viewscript'; redirect "/selectscript"; }; any ['get', 'post'] => '/selectscript' => sub { use Data::Dump qw/ pp /; return pp( cookies() ); }; true;