apr::request::cookie.3
来自「视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.」· 3 代码 · 共 435 行
3
435 行
.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05).\".\" Standard preamble:.\" ========================================================================.de Sh \" Subsection heading.br.if t .Sp.ne 5.PP\fB\\$1\fR.PP...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" '''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 (.Sh), items (.Ip), and index.\" entries marked with X<> in POD. Of course, you'll have to process the.\" output yourself in some meaningful fashion..ie \nF \{\. de IX. tm Index:\\$1\t\\n%\t"\\$2"... nr % 0. rr F.\}.el \{\. de IX...\}.\".\" 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 3".TH Cookie 3 "2008-01-23" "perl v5.10.0" "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 methodsfor interfacing with libapreq2's cookie \s-1API\s0. It also providesa few utility functions and constants..PPThis manpage documents version 2.08of the APR::Request::Cookie package..SH "OVERLOADS".IX Header "OVERLOADS"APR::Request::Cookie.ie n .Sh """""".el .Sh "``''".IX Subsection """""".Vb 1\& "$cookie".Ve.PPThe 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.Sh "new".IX Subsection "new".Vb 4\& APR::Request::Cookie\->new($pool,\& name => $name,\& value => $value,\& %args).Ve.PPCreates 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 transformedinto 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 "\-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.PPFor details on these arguments, please consultthe corresponding method's documentation..Sh "freeze".IX Subsection "freeze".Vb 1\& APR::Request::Cookie\->freeze($value).Ve.PPClass 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.Sh "thaw".IX Subsection "thaw".Vb 1\& $cookie\->thaw().Ve.PPReverses \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.Sh "name".IX Subsection "name".Vb 1\& $cookie\->name().Ve.PPFetch the cookie's name. This attributecannot be modified and is never serialized;ie \fIfreeze()\fR and \fIthaw()\fR do not act on thecookie's name..Sh "value".IX Subsection "value".Vb 1\& $cookie\->value().Ve.PPFetch the cookie's raw (frozen) value.This attribute cannot be modified..Sh "secure".IX Subsection "secure".Vb 2\& $cookie\->secure()\& $cookie\->secure($set).Ve.PPGet/set the cookie's secure flag..PP.Vb 2\& $cookie\->secure(1);\& ok $cookie\->secure == 1;.Ve.Sh "version".IX Subsection "version".Vb 2\& $cookie\->version()\& $cookie\->version($set).Ve.PPGet/set the cookie's version number.Version 0 cookies conform to the Netscapespec; Version 1 cookies conform to either\&\s-1RFC\s0 2109 or \s-1RFC\s0 2965..PP.Vb 3\& $version = $cookie\->version;\& $cookie\->version(1);\& ok $cookie\->version == 1;.Ve.Sh "path".IX Subsection "path".Vb 2\& $cookie\->path()\& $cookie\->path($set).Ve.PPGet/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.Sh "domain".IX Subsection "domain".Vb 2\& $cookie\->domain()\& $cookie\->domain($set).Ve.PPGet/set the cookie's domain string..PP.Vb 3\& $domain = $cookie\->domain;\& $cookie\->domain("apache.org");\& ok $cookie\->domain eq "apache.org";.Ve.Sh "port".IX Subsection "port".Vb 2\& $cookie\->port()\& $cookie\->port($set).Ve.PPGet/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.Sh "comment".IX Subsection "comment".Vb 2\& $cookie\->comment()\& $cookie\->comment($set).Ve.PPGet/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.Sh "commentURL".IX Subsection "commentURL".Vb 2\& $cookie\->commentURL()\& $cookie\->commentURL($set).Ve.PPGet/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.Sh "is_tainted".IX Subsection "is_tainted".Vb 2\& $cookie\->is_tainted()\& $cookie\->is_tainted($set).Ve.PPGet/set the cookie's internal tainted flag..PP.Vb 3\& $tainted = $cookie\->is_tainted;\& $cookie\->is_tainted(1);\& ok $cookie\->is_tainted == 1;.Ve.Sh "make".IX Subsection "make".Vb 1\& APR::Request::Cookie\->make($pool, $name, $value).Ve.PPFast \s-1XS\s0 cookie constructor invoked by \f(CW\*(C`new()\*(C'\fR.The cookie's raw name & value are taken directly from thepassed in arguments; no freezing/encoding is done on the \f(CW$value\fR..Sh "as_string".IX Subsection "as_string".Vb 1\& $cookie\->as_string().Ve.PPString representation of the cookie, suitable for inclusionin 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.Sh "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 1\& Copyright 2003\-2006 The Apache Software Foundation\&\& Licensed 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
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?