OpenFrame::Cookies(3)

πŸ“¦
version 3.05 Β· 2 versions
, in fedora 43

πŸ’– OpenFrame::Cookies πŸ’–

okay bestie, so we're looking at OpenFrame::Cookies(3) β€” a User Contributed Perl Documentation page, and honestly? it's giving abstract cookie royalty. πŸ‘‘


✨ NAME ✨

OpenFrame::Cookies β€” an abstract cookie class πŸͺ


πŸ¦‹ SYNOPSIS πŸ¦‹

use OpenFrame;
my $cookies = OpenFrame::Cookies->new();
$cookies->set("animal" => "parrot");
my $colour = $cookies->get("colour")->value;
$cookies->delete("colour");
my %cookies = $cookies->get_all();

like, look at her. four whole lines and she's already doing the most. πŸ’…


🌸 DESCRIPTION 🌸

so OpenFrame::Cookies represents cookies inside OpenFrame. and what is a cookie here? it's some kind of storage option on the requesting side. that's the vibe. ✨

cookies are a general mechanism which server side connections can use to both store and retrieve information on the client side of the connection. not me explaining client-side state like it's gossip. 😭

and the way that a simple, persistent, client-side state just... significantly extends the capabilities of Web-based client/server applications?? iconic. truly.

OpenFrame::Cookies is an abstract cookie class for OpenFrame which can represent cookies no matter how they really come to exist outside OpenFrame β€” like CGI or Apache cookie objects. she doesn't care where you came from, she just holds you. 🫢


πŸ‘‘ METHODS πŸ‘‘

πŸŽ€ new()

the new() method creates a new OpenFrame::Cookies object. and get this β€” these can hold multiple cookies inside the cookie tin, though they must have unique names. no name-stealing in this household. 🚫πŸͺ

my $cookies = OpenFrame::Cookies->new();

πŸ“ set()

the set() method adds an entry:

$cookies->set("animal" => "parrot");

put a little parrot in there. she's persistent now. 🦜✨

πŸ’œ get()

the get() method returns a cookie (a OpenFrame::Cookie object) given its name:

my $colour = $cookies->get("colour")->value;

note the ->value bestie, you're getting the object and then reaching for the actual value. iykyk. πŸ’…

🌈 delete()

the delete() method removes a cookie element given its name:

$cookies->delete("colour");

gone. deleted. not me being emotionally normal about it. πŸ’€

⭐ get_all()

the get_all() method returns a hash of all the cookies:

my %cookies = $cookies->get_all();

every single one. the whole tin. the entire squad. 🧚


🌟 AUTHOR 🌟

James Duncan <jduncan@fotango.com>, Leon Brocard <leon@fotango.com> 🫢


okay and for the cute sign-off: this whole thing is running on perl v5.42.0, dated 2025-07-25, and it's OpenFrame::Cookies(3) β€” so go forth and store your little client-side state, bestie. slay. πŸŽ€πŸ’–

πŸ“¦ where this page comes from