Name
cookie
Synopsis
$
cookie=$query->cookie('name')
Defines or retrieves a cookie. See also header.
nameName 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=>expcodeSpecifies an expiration timestamp (such as
+3dfor three days). Values forexpcodeare:nsnsecondsnmnminutesnhnhoursndndaysnMnmonthsnynyearsday_of_week,dd-MMM-YY hh:mm:ssGMTAt the specified time.
nowExpires 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=>1Use this cookie only for a secure session.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access