.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Cookie 3pm" .TH Cookie 3pm "2014-07-17" "perl v5.18.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" APR::Request::Cookie \- wrapper for libapreq2's cookie API. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use APR::Request::Cookie; \& \& # fetch inbound cookie \& $jar = $req\->jar; \& $cookie1 = $jar\->get("cookie1"); \& \& # generate new cookie \& $cookie = APR::Request::Cookie\->new($req\->pool, \& name => "foo", \& value => "bar", \& domain => "capricorn.com"); \& print "$cookie"; # prints "bar" \& \& $cookie\->domain("example.com"); # change domains \& $cookie\->version(1); # upgrade it to conform with RFC 2109/2965. \& \& # send a response header \& print sprintf "Set\-Cookie: %s\en", $cookie\->as_string; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The APR::Request::Cookie module provides base methods for interfacing with libapreq2's cookie \s-1API. \s0 It also provides a few utility functions and constants. .PP This manpage documents version 2.13 of the APR::Request::Cookie package. .SH "OVERLOADS" .IX Header "OVERLOADS" APR::Request::Cookie .ie n .SS """""" .el .SS "``''" .IX Subsection """""" .Vb 1 \& "$cookie" .Ve .PP The double-quote interpolation operator maps to \&\f(CW\*(C`APR::Request::Cookie::value()\*(C'\fR. .PP .Vb 1 \& ok "$cookie" eq $cookie\->value; .Ve .SH "METHODS" .IX Header "METHODS" APR::Request::Cookie .SS "new" .IX Subsection "new" .Vb 4 \& APR::Request::Cookie\->new($pool, \& name => $name, \& value => $value, \& %args) .Ve .PP Creates a new cookie. Here \f(CW$pool\fR is an APR::Pool object, and \f(CW$name\fR is the cookie's name. The \f(CW$value\fR is transformed into the cookie's raw value through the class' \f(CW\*(C`freeze()\*(C'\fR method. The remaining arguments are optional: .IP "\-secure" 4 .IX Item "-secure" .PD 0 .IP "\-httponly" 4 .IX Item "-httponly" .IP "\-version" 4 .IX Item "-version" .IP "\-path" 4 .IX Item "-path" .IP "\-domain" 4 .IX Item "-domain" .IP "\-port" 4 .IX Item "-port" .IP "\-expires" 4 .IX Item "-expires" .IP "\-comment" 4 .IX Item "-comment" .IP "\-commentURL" 4 .IX Item "-commentURL" .PD .PP For details on these arguments, please consult the corresponding method's documentation. .SS "freeze" .IX Subsection "freeze" .Vb 1 \& APR::Request::Cookie\->freeze($value) .Ve .PP Class method representing the default serializer; here it returns \f(CW$value\fR unmodified. .PP .Vb 1 \& ok "foo" eq APR::Request::Cookie\->freeze("foo"); .Ve .SS "thaw" .IX Subsection "thaw" .Vb 1 \& $cookie\->thaw() .Ve .PP Reverses \f(CW\*(C`freeze()\*(C'\fR; here it simply returns \&\f(CW$cookie\fR\->value since \fIfreeze()\fR is a noop. .PP .Vb 1 \& ok $cookie\->thaw eq $cookie\->value; .Ve .SS "name" .IX Subsection "name" .Vb 1 \& $cookie\->name() .Ve .PP Fetch the cookie's name. This attribute cannot be modified and is never serialized; ie \fIfreeze()\fR and \fIthaw()\fR do not act on the cookie's name. .SS "value" .IX Subsection "value" .Vb 1 \& $cookie\->value() .Ve .PP Fetch the cookie's raw (frozen) value. This attribute cannot be modified. .SS "secure" .IX Subsection "secure" .Vb 2 \& $cookie\->secure() \& $cookie\->secure($set) .Ve .PP Get/set the cookie's secure flag. .PP .Vb 2 \& $cookie\->secure(1); \& ok $cookie\->secure == 1; .Ve .SS "httponly" .IX Subsection "httponly" .Vb 2 \& $cookie\->httponly() \& $cookie\->httponly($set) .Ve .PP Get/set the cookie's HttpOnly flag. .PP .Vb 2 \& $cookie\->httponly(1); \& ok $cookie\->httponly == 1; .Ve .SS "version" .IX Subsection "version" .Vb 2 \& $cookie\->version() \& $cookie\->version($set) .Ve .PP Get/set the cookie's version number. Version 0 cookies conform to the Netscape spec; Version 1 cookies conform to either \&\s-1RFC 2109\s0 or \s-1RFC 2965.\s0 .PP .Vb 3 \& $version = $cookie\->version; \& $cookie\->version(1); \& ok $cookie\->version == 1; .Ve .SS "path" .IX Subsection "path" .Vb 2 \& $cookie\->path() \& $cookie\->path($set) .Ve .PP Get/set the cookie's path string. .PP .Vb 3 \& $path = $cookie\->path; \& $cookie\->path("/1/2/3/4"); \& ok $cookie\->path eq "/1/2/3/4"; .Ve .SS "domain" .IX Subsection "domain" .Vb 2 \& $cookie\->domain() \& $cookie\->domain($set) .Ve .PP Get/set the cookie's domain string. .PP .Vb 3 \& $domain = $cookie\->domain; \& $cookie\->domain("apache.org"); \& ok $cookie\->domain eq "apache.org"; .Ve .SS "port" .IX Subsection "port" .Vb 2 \& $cookie\->port() \& $cookie\->port($set) .Ve .PP Get/set the cookie's port string. Only valid for Version 1 cookies. .PP .Vb 3 \& $port = $cookie\->port; \& $cookie\->port(8888); \& ok $cookie\->port == 8888; .Ve .SS "comment" .IX Subsection "comment" .Vb 2 \& $cookie\->comment() \& $cookie\->comment($set) .Ve .PP Get/set the cookie's comment string. Only valid for Version 1 cookies. .PP .Vb 3 \& $comment = $cookie\->comment; \& $cookie\->comment("quux"); \& ok $cookie\->comment eq "quux"; .Ve .SS "commentURL" .IX Subsection "commentURL" .Vb 2 \& $cookie\->commentURL() \& $cookie\->commentURL($set) .Ve .PP Get/set the cookie's commentURL string. Only valid for Version 1 cookies. .PP .Vb 3 \& $commentURL = $cookie\->commentURL; \& $cookie\->commentURL("/foo/bar"); \& ok $cookie\->commentURL eq "/foo/bar"; .Ve .SS "is_tainted" .IX Subsection "is_tainted" .Vb 2 \& $cookie\->is_tainted() \& $cookie\->is_tainted($set) .Ve .PP Get/set the cookie's internal tainted flag. .PP .Vb 3 \& $tainted = $cookie\->is_tainted; \& $cookie\->is_tainted(1); \& ok $cookie\->is_tainted == 1; .Ve .SS "make" .IX Subsection "make" .Vb 1 \& APR::Request::Cookie\->make($pool, $name, $value) .Ve .PP Fast \s-1XS\s0 cookie constructor invoked by \f(CW\*(C`new()\*(C'\fR. The cookie's raw name & value are taken directly from the passed in arguments; no freezing/encoding is done on the \f(CW$value\fR. .SS "as_string" .IX Subsection "as_string" .Vb 1 \& $cookie\->as_string() .Ve .PP String representation of the cookie, suitable for inclusion in a \*(L"Set-Cookie\*(R" header. .PP .Vb 1 \& print "Set\-Cookie: ", $cookie\->as_string, "\en"; .Ve .SH "SUBROUTINES" .IX Header "SUBROUTINES" .Vb 1 \& APR::Request::Cookie .Ve .SS "expires" .IX Subsection "expires" .Vb 1 \& expires($date_string) .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" Apache2::Cookie, APR::Request. .SH "COPYRIGHT" .IX Header "COPYRIGHT" .Vb 6 \& Licensed to the Apache Software Foundation (ASF) under one or more \& contributor license agreements. See the NOTICE file distributed with \& this work for additional information regarding copyright ownership. \& The ASF licenses this file to You under the Apache License, Version 2.0 \& (the "License"); you may not use this file except in compliance with \& the License. You may obtain a copy of the License at \& \& http://www.apache.org/licenses/LICENSE\-2.0 \& \& Unless required by applicable law or agreed to in writing, software \& distributed under the License is distributed on an "AS IS" BASIS, \& WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \& See the License for the specific language governing permissions and \& limitations under the License. .Ve