start page | rating of books | rating of authors | reviews | copyrights

Perl in a Nutshell

Perl in a NutshellSearch this book
Previous: Reference: checkbox_group Chapter 10
The CGI.pm Module
Next: Reference: defaults
 

cookie

 
$cookie

=

$query

->cookie(
'
name
'
)

Defines or retrieves a cookie. See also header .

name

Name of the cookie (required).

Using named parameters, the syntax is:

$cookie = $query->cookie(-name=>'
name
',                          -value=>'
value
',                          -expires=>'
expcode
',                          -path=>'
partial_url
',                          -domain=>'
domain_name
',                          -secure=>1); print $query->header(-cookie=>$cookie);

-value=>' value '

A value to assign to the cookie. You can supply a scalar value, or a reference to an array or hash. If omitted, a cookie will be retrieved rather than defined.

-expires=> expcode

Specify an expiration timestamp (such as +3d for 3 days). Values for expcode are:

n s

n seconds

n m

n minutes

n h

n hours

n d

n days

n M

n months

n Y

n years

day_of_week , dd - MMM - YY hh:mm:ss GMT

At the specified time

now

Expire immediately.

-path=>' partial_url '

The partial URL for which the cookie is valid. Default is the current URL.

-domain=>' domain_name '

The domain for which the cookie is valid.

-secure=>1

Only use this cookie for a secure session.


Previous: Reference: checkbox_group Perl in a Nutshell Next: Reference: defaults
Reference: checkbox_group Book Index Reference: defaults