Name

Bric::Util::Cookie - Wrapper around Apache::Cookie, Apache2::Cookie, and CGI::Cookie

Synopsis

use Bric::Util::Cookie;
my $cookie = Bric::Util::Cookie->new($r);
$cookie->bake;

Description

This package subclasses the Apache::Cookie, Apache2::Cookie, or CGI::Cookie class so that Bricolage doesn't have to care about which version of Apache is running, or whether it is running at all.

Interface

Constructor

my $cookie = Bric::Util::Cookie->new($r, ...);

Returns a new Bric::Util::Cookie object, which is actually either an Apache::Cookie object for mod_perl 1 or an Apache2::Cookie object for mod_perl 2.

In Apache::Cookie or Apache2::Cookie this method requires the $r object to be passed in, so you should always pass the $r object for compatibility.

Class methods

my %cookies = Bric::Util::Cookie->fetch($r);

Returns a cookies hash. In Apache2::Cookie this method requires the $r object to be passed in, so you should always pass the $r object for compatibility.

Instance methods

Methods not documented here, like value, are inherited from the base class.

$cookie->bake($r);

In Apache2::Cookie this method requires the $r object to be passed in, so you should always pass the $r object for compatibility.

Author

Scott Lanning <slanning@cpan.org>