How do I simply set a cookie? I'm talking about plain old cookies, not fancy session stuff. Right now, I'm doing: push_header( "Set-Cookie" => "baz=qux"); inside a route and it's not working. Also, I'd like to set multiple key=value pairs. I want to set the cookies and redirect. Thanks, GJ
On 03/07/2012 08:19 AM, GJ wrote:
How do I simply set a cookie? I'm talking about plain old cookies, not fancy session stuff. Right now, I'm doing:
push_header( "Set-Cookie" => "baz=qux");
inside a route and it's not working. Also, I'd like to set multiple key=value pairs. I want to set the cookies and redirect.
Please check cookie and cookies keywords in Dancer documentation. Regards Racke -- LinuXia Systems => http://www.linuxia.de/ Expert Interchange Consulting and System Administration ICDEVGROUP => http://www.icdevgroup.org/ Interchange Development Team
On Wed, Mar 07, 2012 at 08:32:48AM +0100, Stefan Hornburg (Racke) wrote:
On 03/07/2012 08:19 AM, GJ wrote:
How do I simply set a cookie? I'm talking about plain old cookies, not fancy session stuff. Right now, I'm doing:
push_header( "Set-Cookie" => "baz=qux");
inside a route and it's not working. Also, I'd like to set multiple key=value pairs. I want to set the cookies and redirect.
Please check cookie and cookies keywords in Dancer documentation.
Regards Racke
Sorry, I wasn't being clear at all. I know about the (multiple ways of) creating a cookie. I want to know how people are _sending_ _multiple_ cookies back with the response header. Thanks, GJ
On Wed, 7 Mar 2012 15:13:53 +0000 GJ <gj@freeshell.org> wrote:
Sorry, I wasn't being clear at all. I know about the (multiple ways of) creating a cookie. I want to know how people are _sending_ _multiple_ cookies back with the response header.
Call set_cookie as many times as you need; when the response is generated, they should all be sent. e.g. set_cookie foo => 'Foo!'; set_cookie bar => 'Bar!'; -- David Precious ("bigpresh") <davidp@preshweb.co.uk> http://www.preshweb.co.uk/ www.preshweb.co.uk/twitter www.preshweb.co.uk/linkedin www.preshweb.co.uk/facebook www.preshweb.co.uk/cpan www.preshweb.co.uk/github
set_cookie 'name' => 'value', %opts From http://perldancer.org/resources/dancer-cheat-sheet.pdf I just googled 'perl dancer set cookie' Jonathan Otsuka On Mar 7, 2012, at 1:19 AM, GJ <gj@freeshell.org> wrote:
How do I simply set a cookie? I'm talking about plain old cookies, not fancy session stuff. Right now, I'm doing:
push_header( "Set-Cookie" => "baz=qux");
inside a route and it's not working. Also, I'd like to set multiple key=value pairs. I want to set the cookies and redirect.
Thanks, GJ _______________________________________________ Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
participants (4)
-
David Precious -
GJ -
Jonathan Otsuka -
Stefan Hornburg (Racke)