The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
.TH "include/apreq_cookie.h" 3 "6 Mar 2009" "Version 2.12" "libapreq2" \" -*- nroff -*-
.ad l
.nh
.SH NAME
include/apreq_cookie.h \- Cookies and Jars. 
.SH SYNOPSIS
.br
.PP
\fC#include 'apreq.h'\fP
.br
\fC#include 'apr_time.h'\fP
.br

.SS "Data Structures"

.in +1c
.ti -1c
.RI "struct \fBapreq_cookie_t\fP"
.br
.RI "\fICookie type, supporting both Netscape and RFC cookie specifications. \fP"
.in -1c
.SS "Defines"

.in +1c
.ti -1c
.RI "#define \fBAPREQ_COOKIE_MAX_LENGTH\fP   4096"
.br
.in -1c
.SS "Functions"

.in +1c
.ti -1c
.RI "static APR_INLINE \fBapreq_cookie_t\fP * \fBapreq_value_to_cookie\fP (const char *val)"
.br
.ti -1c
.RI "static APR_INLINE unsigned \fBapreq_cookie_version\fP (const \fBapreq_cookie_t\fP *c)"
.br
.ti -1c
.RI "static APR_INLINE void \fBapreq_cookie_version_set\fP (\fBapreq_cookie_t\fP *c, unsigned v)"
.br
.ti -1c
.RI "static APR_INLINE unsigned \fBapreq_cookie_is_secure\fP (const \fBapreq_cookie_t\fP *c)"
.br
.ti -1c
.RI "static APR_INLINE void \fBapreq_cookie_secure_on\fP (\fBapreq_cookie_t\fP *c)"
.br
.ti -1c
.RI "static APR_INLINE void \fBapreq_cookie_secure_off\fP (\fBapreq_cookie_t\fP *c)"
.br
.ti -1c
.RI "static APR_INLINE unsigned \fBapreq_cookie_is_tainted\fP (const \fBapreq_cookie_t\fP *c)"
.br
.ti -1c
.RI "static APR_INLINE void \fBapreq_cookie_tainted_on\fP (\fBapreq_cookie_t\fP *c)"
.br
.ti -1c
.RI "static APR_INLINE void \fBapreq_cookie_tainted_off\fP (\fBapreq_cookie_t\fP *c)"
.br
.ti -1c
.RI "\fBapr_status_t\fP \fBapreq_parse_cookie_header\fP (\fBapr_pool_t\fP *pool, \fBapr_table_t\fP *jar, const char *header)"
.br
.ti -1c
.RI "\fBapreq_cookie_t\fP * \fBapreq_cookie_make\fP (\fBapr_pool_t\fP *pool, const char *name, const \fBapr_size_t\fP nlen, const char *value, const \fBapr_size_t\fP vlen)"
.br
.ti -1c
.RI "char * \fBapreq_cookie_as_string\fP (const \fBapreq_cookie_t\fP *c, \fBapr_pool_t\fP *\fBp\fP)"
.br
.ti -1c
.RI "int \fBapreq_cookie_serialize\fP (const \fBapreq_cookie_t\fP *c, char *buf, \fBapr_size_t\fP \fBlen\fP)"
.br
.ti -1c
.RI "void \fBapreq_cookie_expires\fP (\fBapreq_cookie_t\fP *c, const char *time_str)"
.br
.in -1c
.SH "Detailed Description"
.PP 
Cookies and Jars. 

\fBapreq_cookie.h\fP describes a common server-side API for request (incoming) and response (outgoing) cookies. It aims towards compliance with the standard cookie specifications listed below.
.PP
\fBSee also:\fP
.RS 4
http://wp.netscape.com/newsref/std/cookie_spec.html 
.PP
http://www.ietf.org/rfc/rfc2109.txt 
.PP
http://www.ietf.org/rfc/rfc2964.txt 
.PP
http://www.ietf.org/rfc/rfc2965.txt 
.RE
.PP

.SH "Define Documentation"
.PP 
.SS "#define APREQ_COOKIE_MAX_LENGTH   4096"
.PP
\fBTodo\fP
.RS 4
convert this macro to an \fBapreq_module_t\fP method.
.RE
.PP
Maximum length of a single Set-Cookie(2) header. 
.SH "Function Documentation"
.PP 
.SS "char* apreq_cookie_as_string (const \fBapreq_cookie_t\fP * c, \fBapr_pool_t\fP * p)"
.PP
Returns a string that represents the cookie as it would appear in a valid 'Set-Cookie*' header.
.PP
\fBParameters:\fP
.RS 4
\fIc\fP cookie. 
.br
\fIp\fP pool which allocates the returned string.
.RE
.PP
\fBReturns:\fP
.RS 4
header string. 
.RE
.PP

.SS "void apreq_cookie_expires (\fBapreq_cookie_t\fP * c, const char * time_str)"
.PP
Set the Cookie's expiration date.
.PP
\fBParameters:\fP
.RS 4
\fIc\fP The cookie. 
.br
\fItime_str\fP If NULL, the Cookie's expiration date is unset, making it a session cookie. This means no 'expires' or 'max-age' attribute will appear in the cookie's serialized form. If time_str is not NULL, the expiration date will be reset to the offset (from now) represented by time_str. The time_str should be in a format that \fBapreq_atoi64t()\fP can understand, namely /[+-]?\\d+\\s*[YMDhms]/.
.RE
.PP
\fBRemarks:\fP
.RS 4
Now time_str may also be a fixed date; see \fBapr_date_parse_rfc()\fP for admissible formats. 
.RE
.PP

.SS "static APR_INLINE unsigned apreq_cookie_is_secure (const \fBapreq_cookie_t\fP * c)\fC [static]\fP"
.PP
\fBReturns:\fP
.RS 4
1 if the secure flag is set, 0 otherwise. 
.RE
.PP

.SS "static APR_INLINE unsigned apreq_cookie_is_tainted (const \fBapreq_cookie_t\fP * c)\fC [static]\fP"
.PP
\fBReturns:\fP
.RS 4
1 if the taint flag is set, 0 otherwise. 
.RE
.PP

.SS "\fBapreq_cookie_t\fP* apreq_cookie_make (\fBapr_pool_t\fP * pool, const char * name, const \fBapr_size_t\fP nlen, const char * value, const \fBapr_size_t\fP vlen)"
.PP
Returns a new cookie, made from the argument list.
.PP
\fBParameters:\fP
.RS 4
\fIpool\fP Pool which allocates the cookie. 
.br
\fIname\fP The cookie's name. 
.br
\fInlen\fP Length of name. 
.br
\fIvalue\fP The cookie's value. 
.br
\fIvlen\fP Length of value.
.RE
.PP
\fBReturns:\fP
.RS 4
the new cookie 
.RE
.PP

.SS "static APR_INLINE void apreq_cookie_secure_off (\fBapreq_cookie_t\fP * c)\fC [static]\fP"
.PP
Turns off the cookie's secure flag. 
.SS "static APR_INLINE void apreq_cookie_secure_on (\fBapreq_cookie_t\fP * c)\fC [static]\fP"
.PP
Sets the cookie's secure flag, meaning it only comes back over an SSL-encrypted connction. 
.SS "int apreq_cookie_serialize (const \fBapreq_cookie_t\fP * c, char * buf, \fBapr_size_t\fP len)"
.PP
Same functionality as apreq_cookie_as_string. Stores the string representation in buf, using up to len bytes in buf as storage. The return value has the same semantics as that of apr_snprintf, including the special behavior for a 'len = 0' argument.
.PP
\fBParameters:\fP
.RS 4
\fIc\fP cookie. 
.br
\fIbuf\fP storage location for the result. 
.br
\fIlen\fP size of buf's storage area.
.RE
.PP
\fBReturns:\fP
.RS 4
size of resulting header string. 
.RE
.PP

.SS "static APR_INLINE void apreq_cookie_tainted_off (\fBapreq_cookie_t\fP * c)\fC [static]\fP"
.PP
Turns off the cookie's tainted flag. 
.SS "static APR_INLINE void apreq_cookie_tainted_on (\fBapreq_cookie_t\fP * c)\fC [static]\fP"
.PP
Sets the cookie's tainted flag. 
.SS "static APR_INLINE unsigned apreq_cookie_version (const \fBapreq_cookie_t\fP * c)\fC [static]\fP"
.PP
\fBReturns:\fP
.RS 4
1 if this is an RFC cookie, 0 if its a Netscape cookie. 
.RE
.PP

.SS "static APR_INLINE void apreq_cookie_version_set (\fBapreq_cookie_t\fP * c, unsigned v)\fC [static]\fP"
.PP
Sets the cookie's protocol version. 
.SS "\fBapr_status_t\fP apreq_parse_cookie_header (\fBapr_pool_t\fP * pool, \fBapr_table_t\fP * jar, const char * header)"
.PP
Parse a cookie header and store the cookies in an apr_table_t.
.PP
\fBParameters:\fP
.RS 4
\fIpool\fP pool which allocates the cookies 
.br
\fIjar\fP table where parsed cookies are stored 
.br
\fIheader\fP the header value
.RE
.PP
\fBReturns:\fP
.RS 4
APR_SUCCESS. 
.PP
\fBAPREQ_ERROR_BADSEQ\fP if an unparseable character sequence appears. 
.PP
\fBAPREQ_ERROR_MISMATCH\fP if an rfc-cookie attribute appears in a netscape cookie header. 
.PP
APR_ENOTIMPL if an unrecognized rfc-cookie attribute appears. 
.PP
\fBAPREQ_ERROR_NOTOKEN\fP if a required token was not present. 
.PP
\fBAPREQ_ERROR_BADCHAR\fP if an unexpected token was present. 
.RE
.PP

.SS "static APR_INLINE \fBapreq_cookie_t\fP* apreq_value_to_cookie (const char * val)\fC [static]\fP"
.PP
Upgrades a jar's table values to \fBapreq_cookie_t\fP structs. 
.SH "Author"
.PP 
Generated automatically by Doxygen for libapreq2 from the source code.