Dancer::Cookies(3pm)
π Dancer::Cookies π
okay bestie, so this is Dancer::Cookies β a singleton storage for all cookies. one storage, all the cookies, living together, iconic behavior honestly. β¨
and the version? version 1.3522. noted. slayed.
πΈ SYNOPSIS πΈ
here's the vibe, fr fr:
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";
}
cookie lang => "fr-FR"; #set a cookie and return its value
cookie lang => "fr-FR", expires => "2 hours";
cookie "lang" #return a cookie value
look at that. she's serving. π
π DESCRIPTION π
so Dancer::Cookies literally keeps all the cookies defined by the application β like, all of them, no cookie left behind. π it makes them accessible and also hands you a few helper functions for cookie handling, all tied to the stored cookies. it's giving personal assistant for cookies. main character energy fr.
π METHODS π
π init
this one gets called whenever ->new() happens. it builds up a storage of cookies by parsing them out of the environment using parse_cookies_from_env β which is described below, so keep scrolling bestie π«Ά
π cookies
returns a hash reference of all the cookies, and every single one of them is a Dancer::Cookie type object. obsessed.
- the key is the cookie name π·οΈ
- the value is the
Dancer::Cookieobject πͺ
π cookie
the cookie method is your girl when you wanna query or set cookies easily. no stress, just vibes:
cookie lang => "fr-FR"; # set a cookie and return its value
cookie lang => "fr-FR", expires => "2 hours"; # extra cookie info
cookie "lang" # return a cookie value
set it, get it, add extra info to it β she does it all. π§
π parse_cookie_from_env
this one fetches all the cookies from the environment, parses them, and creates a hashref of all the cookies. π
and yep β it also returns all the hashref it created. so you get the whole thing back. generous queen.
π tiny heads up: theinitmethod up above calls itparse_cookies_from_env(with an "s" in the middle), but this method right here isparse_cookie_from_env. spelling is different, they're written exactly like that in the original, so i'm keeping both exactly like that. no editing, no guessing. periodt. β
π¦ AUTHOR π¦
Dancer Core Developers. legends only. π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2010 by Alexis Sukrieh. π
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. πͺ
and that's the whole page bestie!! π this was Dancer::Cookies(3pm), perl v5.40.1, dated 2026-05-05 β go forth and handle your cookies responsibly, muah πβ¨
π¦ where this page comes from
- ubuntu stonking: libdancer-perl 1.3522-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms