Apache2::Cookie(3pm)

Apache2::Cookie3pm

Http cookies class

Usage

    use Apache2::Cookie;
    $j = Apache2::Cookie::Jar->new($r);
    $c_in = $j->cookies("foo");         # get cookie from request headers
    $c_out = Apache2::Cookie->new($r,
                                  -name  => "mycookie",
                                  -value => $c_in->name );
    $c_out->path("/bar");               # set path to "/bar"
    $c_out->bake($r);                   # send cookie in response headers

Overview

The Apache2::Cookie module is based on the original 1.X versions, which mimic the CGI::Cookie API. The current version of this module includes several packages and methods which are patterned after Apache2::Request, yet remain largely backwards-compatible with the original 1.X API (see the "PORTING from 1.X" section below for known issues).

This manpage documents the Apache2::Cookie and Apache2::Cookie::Jar packages.

PORTING from 1.X

Changes to the 1.X API:

•

"Apache2::Cookie::fetch" now expects an $r object as (second)
argument, although this isn't necessary in mod_perl 2 if
"Apache2::RequestUtil" is loaded and 'PerlOptions +GlobalRequest'
is in effect.

•

"Apache2::Cookie::parse" is gone.

•

"Apache2::Cookie::new" no longer encodes the supplied cookie name.

•

Apache2::Cookie::new() returns undef if -value is not specified
or -value => undef.

•

name() and value() no longer accept a "set" argument. In other words,
neither a cookie's name, nor its value, may be modified. A new cookie
should be made instead.

Releases

9 releases since Debian 4.0 (Etch); the text changed 7 times.

  1. 4.0–5.0
  2. 6.0
  3. 7
  4. 8
  5. 9
  6. 10
  7. 11
  8. 13

From libapreq2-doc 2.17-7 in Debian 13 (Trixie). Parsed by carta from the page's man source.