|
apr_status_t | ap_cookie_write (request_rec *r, const char *name, const char *val, const char *attrs, long maxage,...) AP_FN_ATTR_SENTINEL |
|
apr_status_t | ap_cookie_write2 (request_rec *r, const char *name2, const char *val, const char *attrs2, long maxage,...) AP_FN_ATTR_SENTINEL |
|
apr_status_t | ap_cookie_remove (request_rec *r, const char *name, const char *attrs,...) AP_FN_ATTR_SENTINEL |
|
apr_status_t | ap_cookie_remove2 (request_rec *r, const char *name2, const char *attrs2,...) AP_FN_ATTR_SENTINEL |
|
apr_status_t | ap_cookie_read (request_rec *r, const char *name, const char **val, int remove) |
|
apr_status_t | ap_cookie_check_string (const char *string) |
|
RFC2109 and RFC2965 compliant HTTP cookies can be read from and written to using this set of functions.
◆ CLEAR_ATTRS
#define CLEAR_ATTRS "Version=1" |
◆ DEFAULT_ATTRS
#define DEFAULT_ATTRS "HttpOnly;Secure;Version=1" |
◆ SET_COOKIE
#define SET_COOKIE "Set-Cookie" |
◆ SET_COOKIE2
#define SET_COOKIE2 "Set-Cookie2" |
◆ ap_cookie_check_string()
Sanity check a given string that it exists, is not empty, and does not contain the special characters '=', ';' and '&'.
It is used to sanity check the cookie names.
◆ ap_cookie_read()
Read a cookie called name, placing its value in val.
Both the Cookie and Cookie2 headers are scanned for the cookie.
If the cookie is duplicated, this function returns APR_EGENERAL. If found, and if remove is non zero, the cookie will be removed from the headers, and thus kept private from the backend.
◆ ap_cookie_remove()
Remove an RFC2109 compliant cookie.
- Parameters
-
r | The request |
name | The name of the cookie. |
attrs | The string containing additional cookie attributes. If NULL, the CLEAR_ATTRS will be used. |
... | A varargs array of zero or more (apr_table_t *) tables followed by NULL to which the cookies should be added. |
◆ ap_cookie_remove2()
Remove an RFC2965 compliant cookie.
- Parameters
-
r | The request |
name2 | The name of the cookie. |
attrs2 | The string containing additional cookie attributes. If NULL, the CLEAR_ATTRS will be used. |
... | A varargs array of zero or more (apr_table_t *) tables followed by NULL to which the cookies should be added. |
◆ ap_cookie_write()
apr_status_t ap_cookie_write |
( |
request_rec * |
r, |
|
|
const char * |
name, |
|
|
const char * |
val, |
|
|
const char * |
attrs, |
|
|
long |
maxage, |
|
|
|
... |
|
) |
| |
Write an RFC2109 compliant cookie.
- Parameters
-
r | The request |
name | The name of the cookie. |
val | The value to place in the cookie. |
attrs | The string containing additional cookie attributes. If NULL, the DEFAULT_ATTRS will be used. |
maxage | If non zero, a Max-Age header will be added to the cookie. |
... | A varargs array of zero or more (apr_table_t *) tables followed by NULL to which the cookies should be added. |
◆ ap_cookie_write2()
apr_status_t ap_cookie_write2 |
( |
request_rec * |
r, |
|
|
const char * |
name2, |
|
|
const char * |
val, |
|
|
const char * |
attrs2, |
|
|
long |
maxage, |
|
|
|
... |
|
) |
| |
Write an RFC2965 compliant cookie.
- Parameters
-
r | The request |
name2 | The name of the cookie. |
val | The value to place in the cookie. |
attrs2 | The string containing additional cookie attributes. If NULL, the DEFAULT_ATTRS will be used. |
maxage | If non zero, a Max-Age header will be added to the cookie. |
... | A varargs array of zero or more (apr_table_t *) tables followed by NULL to which the cookies should be added. |