Name

new

Synopsis

$c 
                     = new CGI::Cookie(attribs)

Constructor. Creates a new cookie. Attributes are:

-domain = domain_name

Optional. Points to domain name or fully qualified hostname to which cookie will be returned. If missing, browser will return cookie only to the server that set it.

-expires = date

Optional expiration date in any of the date formats recognized by CGI.pm. If missing, cookie expires at the end of this browser session.

-name = name

Required. Scalar value with the cookie name.

-path = path

Optional. Points to a partial URL on the current server; cookies will be returned to any URL beginning with this path. Defaults to /.

-secure = boolean

Optional. If true, browser will return cookie only if a cryptographic protocol is in use.

-value = value

Required. The value of the cookie; can be a scalar, an array reference, or a hash reference.

Get Perl in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.