Hi, We are using dancer2, how can I fetch an existing cookie from the client requests? In dancer1, there is module Dancer::Cookies, we can retrieve all the cookies by doing: my $cookies = Dancer::Cookies->cookies; See the following: use Dancer::Cookies; my $cookies = Dancer::Cookies->cookies; foreach my $name ( keys %{$cookies} ) { my $cookie = $cookies->{$name}; my $value = $cookie->value; print "$name => $value\n"; } Does Dancer2 has equivalent module or are there any ways to fetch a cookie? Your help would be much appreciated! Best, Wendy -- The Wellcome Trust Sanger Institute is operated by Genome Research Limited, a charity registered in England with number 1021457 and a company registered in England with number 2742969, whose registered office is 215 Euston Road, London, NW1 2BE.
* Wanjuan Yang [17/07/2017 14:39] :
Does Dancer2 has equivalent module or are there any ways to fetch a cookie?
Dancer2 has Dancer2::Core::Cookie http://search.cpan.org/~cromedome/Dancer2-0.205001/lib/Dancer2/Core/Cookie.p... Emmanuel
On Mon, 17 Jul 2017 16:45:48 +0200 Emmanuel Seyman wrote:
* Wanjuan Yang [17/07/2017 14:39] :
Does Dancer2 has equivalent module or are there any ways to fetch a cookie?
Dancer2 has Dancer2::Core::Cookie http://search.cpan.org/~cromedome/Dancer2-0.205001/lib/Dancer2/Core/Cookie.p...
If you know the name of the cookie, you can also just do this: my $cookie = cookie 'my_cookie'; Andy
Thank you very much! Andy. Will give it a go! Wendy On 7/17/17, 4:54 PM, "dancer-users on behalf of Andrew Beverley" <dancer-users-bounces@dancer.pm on behalf of andy@andybev.com> wrote: On Mon, 17 Jul 2017 16:45:48 +0200 Emmanuel Seyman wrote: > * Wanjuan Yang [17/07/2017 14:39] : > > > > Does Dancer2 has equivalent module or are there any ways to fetch a cookie? > > Dancer2 has Dancer2::Core::Cookie > http://search.cpan.org/~cromedome/Dancer2-0.205001/lib/Dancer2/Core/Cookie.p... If you know the name of the cookie, you can also just do this: my $cookie = cookie 'my_cookie'; Andy _______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users -- The Wellcome Trust Sanger Institute is operated by Genome Research Limited, a charity registered in England with number 1021457 and a company registered in England with number 2742969, whose registered office is 215 Euston Road, London, NW1 2BE.
participants (3)
-
Andrew Beverley -
Emmanuel Seyman -
Wanjuan Yang