Dancer::Cookie(3pm)
π Dancer::Cookie β class representing cookies π
okay bestie, gather round, because we're talking about the Perl doc for Dancer::Cookie, and it comes to you straight from the User Contributed Perl Documentation section of the manual. yes. we're in the sanctioned lore. π
β¨ VERSION β¨
version 1.3522 β that's the one, don't @ me.
π¦ SYNOPSIS π¦
here's the vibe, look:
use Dancer::Cookie;
my $cookie = Dancer::Cookie->new(
name => $cookie_name, value => $cookie_value
);
literally that's it, that's the whole entrance. iconic of it.
πΈ DESCRIPTION πΈ
so Dancer::Cookie gives you an HTTP cookie object to work with cookies. that's the whole job. it's the little guy that holds your cookie data so you don't have to hand-assemble HTTP headers like some kind of medieval peasant. π
π ATTRIBUTES π
these are the fields. the sliders. the settings. let's go one by one because each one EATS.
π name
the cookie's name. yeah. that's the whole thing. moving on, we have places to be.
π value
the cookie's value. the payload. the whole reason the cookie exists. π
β¨ expires
the cookie's expiration date. and bestie, this one has several formats β it's giving flexibility, it's giving options, it's giving "I contain multitudes".
- Unix epoch time, like
1288817656, which means"Wed, 03-Nov-2010 20:54:16 GMT". - A human-readable offset from the current time, like
"2 hours". rn it understand these ones:
s second seconds sec secs
m minute minutes min mins
h hr hour hours
d day days
w week weeks
M month months
y year years
β οΈ heads up: months and years are currently fixed at 30 and 365 days. this may change. so don't be out here building your entire calendar app on that assumption, okay? π
- anything else is used verbatim. no translation, no notes, you get exactly what you typed.
π¦ domain
the cookie's domain. where it lives. its little neighborhood. π‘
πΈ path
the cookie's path. where within that neighborhood it's allowed to wander.
π secure
if this is true, it tells the client to only serve the cookie over secure connections such as HTTPS. so like, the cookie has a bodyguard. keep it true if you care about your secrets, bestie. π
π http_only
by default, cookies get created with a property named "HttpOnly", and that property is a security thing β it forces the cookie to be used only by the server (via HTTP) and not by any JavaScript code. so no sneaky script can just reach in and grab it. iconic behavior frankly.
if your cookie is meant to be read by some JavaScript code, then set this attribute to 0. that's the escape hatch. that's the "okay fine I trust this one" button. π
π METHODS/SUBROUTINES π
new
creates a new Dancer::Cookie object. π
you can set any attribute described in the ATTRIBUTES section above β so go wild, pass whatever you need, no gatekeeping here.
init
runs an expiration test and sets a default path if one isn't set. it's the little setup gremlin that makes sure you didn't forget the basics. π§
to_header
creates a proper HTTP cookie header from the content. this is the glow-up moment β internal object goes in, header string comes out. periodt. β¨
π AUTHOR π
Dancer Core Developers β the collective, the group chat, the founding mothers and fathers of this whole situation. π«Ά
β 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. so like, go forth, remix, redistribute, it's giving open source generosity. π
and that's the whole manual page, bestie. every flag, every attribute, every "this may change" warning β nothing dropped, nothing invented. iykyk. π₯
okay so as a little sign-off: this page was generated for Dancer::Cookie(3pm) by perl v5.40.1, dated 2026-05-05. go build something cute with your cookies, no cap. πͺππ¦πΈπ
π¦ 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