in reply to Re: Dancer Cookies
in thread Dancer Cookies

GET http://localhost:3000/selectscript
User-Agent: lwp-request/6.03 libwww-perl/6.05

200 OK
Server: Perl Dancer 1.3118
Content-Length: 1537
Content-Type: text/html; charset=utf-8
Client-Date: Wed, 13 Nov 2013 03:46:08 GMT
Client-Peer: 127.0.0.1:3000
Client-Response-Num: 1
Link: <http://localhost:3000/css/style.css>; rel="stylesheet"
Title: scriptanalysiswebapp
X-Powered-By: Perl Dancer 1.3118

Replies are listed 'Best First'.
Re^3: Dancer Cookies
by Anonymous Monk on Nov 13, 2013 at 03:53 UTC
    funny, selectscript doesn't try to set any cookies, only viewscript sets cookies, maybe you want to request viewscript first and show that?

      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;