[dancer-users] Handling cookies on D2
davidp at preshweb.co.uk
Fri Apr 19 18:12:22 BST 2013
On Fri, 19 Apr 2013 19:39:02 +0300
Punter <punter at punter.gr> wrote:
> My inspiration for this pull request was this supposed documentation
> that describes how the "cookie" keyword works:
Yes, the manual still needs some work. You're looking at unfinished
work on my branch. That's why it's not shipped with Dancer2 yet.
Looking at the Dancer2 code, you'll get Dancer2::Core::Cookie objects
That's the design, and I'm not aware of any plans for it to change.
You can fetch a cookie with:
my $cookie = cookie 'foo';
my $value = $cookie->value;
One change that I think would be valuable actually would be to have
Dancer2::Core::Cookie use overloading, so that a Dancer2::Core::Cookie
object stringifies to its value - a bit of DWIMmery.
I'll look in to that and discuss it with the rest of the team.
David Precious ("bigpresh") <davidp at preshweb.co.uk>
More information about the dancer-users