OpenFrame::Cookies - An abstract cookie class
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();
OpenFrame::Cookies represents cookies inside OpenFrame. Cookies in OpenFrame represent some kind of storage option on the requesting side.
OpenFrame::Cookies
Cookies are a general mechanism which server side connections can use to both store and retrieve information on the client side of the connection. The addition of a simple, persistent, client-side state significantly extends the capabilities of Web-based client/server applications. OpenFrame::Cookies is an abstract cookie class for OpenFrame which can represent cookies no matter how they really come to exist outside OpenFrame (such as CGI or Apache cookie objects).
The new() method creates a new OpenFrame::Cookies object. These can hold multiple cookies (although they must have unique names) inside the cookie tin.
my $cookies = OpenFrame::Cookies->new();
The set() method adds an entry:
$cookies->set("animal" => "parrot");
The get() method returns a cookie (a OpenFrame::Cookie object) given its name:
OpenFrame::Cookie
my $colour = $cookies->get("colour")->value;
The delete() method removes a cookie element given its name:
$cookies->delete("colour");
The get_all() method returns a hash of all the cookies:
my %cookies = $cookies->get_all();
James Duncan <jduncan@fotango.com>, Leon Brocard <leon@fotango.com>
To install OpenFrame, copy and paste the appropriate command in to your terminal.
cpanm
cpanm OpenFrame
CPAN shell
perl -MCPAN -e shell install OpenFrame
For more information on module installation, please visit the detailed CPAN module installation guide.