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

funny, selectscript doesn't try to set any cookies, only viewscript sets cookies, maybe you want to request viewscript first and show that?

Replies are listed 'Best First'.
Re^4: Dancer Cookies
by nathaniels (Acolyte) on Nov 13, 2013 at 04:01 UTC

    I get an uninitialized value error.

      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;