CGI::Simple::Cookie(3pm)

CGI::Simple::Cookie3pm

Interface to http cookies

Usage

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

Overview

CGI::Simple::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::Simple::Cookie is intended to be used in conjunction with CGI::Simple (and is in fact used by it internally), you can use this module independently.

For full information on cookies see:

    http://tools.ietf.org/html/rfc2109
    http://tools.ietf.org/html/rfc2965
    https://dcthetall.github.io/CHIPS-spec/draft-cutler-httpbis-partitioned-cookies.html

Author information

Original version copyright 1997-1998, Lincoln D. Stein. All rights reserved. Originally copyright 2001 Dr James Freeman <[email protected]> This release by Andy Armstrong <[email protected]>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Address bug reports and comments to: [email protected]

Releases

11 releases since Debian 3.1 (Sarge); the text changed 7 times.

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

Bugs

This section intentionally left blank :-)

From libcgi-simple-perl 1.282-1~deb13u1 in Debian 13 (Trixie). Parsed by carta from the page's man source.