OpenFrame::Cookies(3)
π 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
- fedora 43: perl-OpenFrame 3.05-55.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms