1OpenFrame::Cookies(3) User Contributed Perl DocumentationOpenFrame::Cookies(3)
2
3
4
6 OpenFrame::Cookies - An abstract cookie class
7
9 use OpenFrame;
10 my $cookies = OpenFrame::Cookies->new();
11 $cookies->set("animal" => "parrot");
12 my $colour = $cookies->get("colour")->value;
13 $cookies->delete("colour");
14 my %cookies = $cookies->get_all();
15
17 "OpenFrame::Cookies" represents cookies inside OpenFrame. Cookies in
18 OpenFrame represent some kind of storage option on the requesting side.
19
20 Cookies are a general mechanism which server side connections can use
21 to both store and retrieve information on the client side of the
22 connection. The addition of a simple, persistent, client-side state
23 significantly extends the capabilities of Web-based client/server
24 applications. "OpenFrame::Cookies" is an abstract cookie class for
25 OpenFrame which can represent cookies no matter how they really come to
26 exist outside OpenFrame (such as CGI or Apache cookie objects).
27
29 new()
30 The new() method creates a new "OpenFrame::Cookies" object. These can
31 hold multiple cookies (although they must have unique names) inside the
32 cookie tin.
33
34 my $cookies = OpenFrame::Cookies->new();
35
36 set()
37 The set() method adds an entry:
38
39 $cookies->set("animal" => "parrot");
40
41 get()
42 The get() method returns a cookie (a "OpenFrame::Cookie" object) given
43 its name:
44
45 my $colour = $cookies->get("colour")->value;
46
47 delete()
48 The delete() method removes a cookie element given its name:
49
50 $cookies->delete("colour");
51
52 get_all()
53 The get_all() method returns a hash of all the cookies:
54
55 my %cookies = $cookies->get_all();
56
58 James Duncan <jduncan@fotango.com>, Leon Brocard <leon@fotango.com>
59
60
61
62perl v5.38.0 2023-07-21 OpenFrame::Cookies(3)