CGI::Cookie(3pm)

CGI::Cookie3pm

Interface to http cookies

Usage

    use CGI qw/:standard/;
    use CGI::Cookie;
    # Create new cookies and send them
    $cookie1 = CGI::Cookie->new(-name=>'ID',-value=>123456);
    $cookie2 = CGI::Cookie->new(-name=>'preferences',
                               -value=>{ font => Helvetica,
                                         size => 12 } 
                               );
    print header(-cookie=>[$cookie1,$cookie2]);
    # fetch existing cookies
    %cookies = CGI::Cookie->fetch;
    $id = $cookies{'ID'}->value;
    # create cookies returned from an external source
    %cookies = CGI::Cookie->parse($ENV{COOKIE});

Overview

CGI::Cookie is an interface to HTTP/1.1 cookies, a mechanism that allows Web servers to store persistent information on the browser's side of the connection. Although CGI::Cookie is intended to be used in conjunction with CGI.pm (and is in fact used by it internally), you can use this module independently.

For full information on cookies see

    https://tools.ietf.org/html/rfc6265

Author information

The CGI.pm distribution is copyright 1995-2007, Lincoln D. Stein. It is distributed under the Artistic License 2.0. It is currently maintained by Lee Johnson with help from many contributors.

Address bug reports and comments to: https://github.com/leejo/CGI.pm/issues

The original bug tracker can be found at: https://rt.cpan.org/Public/Dist/Display.html?Queue=CGI.pm

When sending bug reports, please provide the version of CGI.pm, the version of Perl, the name and version of your Web server, and the name and version of the operating system you are using. If the problem is even remotely browser dependent, please provide information about the affected browsers as well.

Releases

12 releases since Debian 2.2 (Potato); the text changed 11 times.

  1. 2.2
  2. 3.0
  3. 5.0
  4. 6.0
  5. 7
  6. 8
  7. 9
  8. 10
  9. 11
  10. 12
  11. 13
  12. Arch

Bugs

This section intentionally left blank.

From perl-cgi 4.72-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.