Dancer::Cookie(3pm)

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. 🫢


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