Subject: | Can't call method "cookies" on an undefined value |
Date: | Tue, 29 Aug 2017 12:28:18 -0400 |
To: | bug-Dancer2-Plugin-CSRF [...] rt.cpan.org |
From: | Robert Williams <rjwill [...] gmail.com> |
When I attempt to add:
csrf_token => get_csrf_token(),
to any of my form templates, I am unable to load them afterwards. I receive
the following error:
Error 500 - Internal Server Error
Runtime Error
Can't call method "cookies" on an undefined value at
/usr/lib/perl5/site_perl/5.18.2/Dancer2/Core/App.pm line 1257.
/usr/lib/perl5/site_perl/5.18.2/Dancer2/Core/App.pm around line 1257
1252 }
1253
1254 sub cookie {
1255 my $self = shift;
1256
1257 @_ == 1 and return $self->request->cookies->{ $_[0] };
1258
1259 # writer
1260 my ( $name, $value, %options ) = @_;
1261 my $c =
1262 Dancer2::Core::Cookie->new( name => $name, value => $value,
%options );
I am using Dancer2::Session::YAML in case that makes a difference.
--
~ Bob