#include <h2o/memory.h>
#include <h2otils/string.h>
#include <htils/basictypes.h>
Go to the source code of this file.
◆ h2o_cookie_param_t
◆ h2o_cookie_t
◆ h2o_same_site_args_t
◆ h2o_cookie_param
| Enumerator |
|---|
| SAME_SITE | |
| HTTP_ONLY | |
| PATH | |
| EXPIRES | |
| MAX_AGE | |
| DOMAIN | |
| SECURE | |
◆ h2o_same_site_args
| Enumerator |
|---|
| INVALID | |
| NONE | |
| LAX | |
| STRICT | |
◆ h2o_cookie_add_param()
Adds a parameter to the cookie.
Checks the parameter, and appends the modifier according to Set-Cookie syntax.
- Parameters
-
| pool | The memory pool to allocate the cookie from. |
| cookie | The cookie to add the parameter to. |
| param | The parameter to add. |
| val | The value of the parameter, if the value is not a pointer, simply get its memory address through &. |
- Precondition
pool, cookie, and val must be valid and cannot be null.
param must be a valid parameter.
◆ h2o_cookie_from_string()
Creates a new cookie from a string.
Parses the string and creates a new cookie from it.
- Parameters
-
| pool | The memory pool to allocate the cookie from. |
| str | The string to parse. |
- Precondition
pool and str must be valid and cannot be null.
- Returns
- A pointer to the new cookie.
◆ h2o_cookie_new()
Creates a new cookie with values.
Allocates a new cookie with the given values to conform to the Set-Cookie syntax.
- Parameters
-
| pool | The memory pool to allocate the cookie from. |
| name | The name of the cookie. |
| value | The value of the cookie. |
- Precondition
pool, name, and value must be valid and cannot be null.
◆ h2o_cookie_to_string()
Converts a cookie to a h2o_string.
Converts the cookie to a h2o_string, according to the Set-Cookie syntax.
- Parameters
-
| pool | The memory pool to allocate the string from. |
| cookie | The cookie to convert. |
- Precondition
pool and cookie must be valid and cannot be null.
- Returns
- A pointer to the new h2o_string.