That said, using a cookie to set a redirect seems unnecessary. Can't you just put it in the redirect URL?
No, unfortunately not -- I'm using an external authentication server and this is the method that it uses to return the user to wherever they were before logging in. :-\ Thanks for the tip -- the problem seems to be in testing the existence/value of the cookie. For unknown reasons, HTTP::Cookies doesn't seem to be parsing the cookie, even though it seems to be present in the HTTP::Headers object. On 4 August 2016 at 14:19, Andrew Beverley <andy@andybev.com> wrote:
On Thu, 4 Aug 2016 13:52:15 Amelia Ireland <aireland@lbl.gov> wrote:
my $c = Dancer2::Core::Cookie->new( name => 'return_to', value => '/', domain => config->{sso_domain}, expires => '5 mins' );
push_response_header 'Set-Cookie' => $c->to_header;
You're probably best just using the cookie keyword:
cookie return_to => '/', expires => ..., domain => ...
That said, using a cookie to set a redirect seems unnecessary. Can't you just put it in the redirect URL?
Andy