Ulfius
HTTP Framework for REST Applications in C
|
Functions | |
int | ulfius_add_cookie_to_response (struct _u_response *response, const char *key, const char *value, const char *expires, const unsigned int max_age, const char *domain, const char *path, const int secure, const int http_only) |
int | ulfius_add_same_site_cookie_to_response (struct _u_response *response, const char *key, const char *value, const char *expires, const unsigned int max_age, const char *domain, const char *path, const int secure, const int http_only, const int same_site) |
Cookies management functions
int ulfius_add_cookie_to_response | ( | struct _u_response * | response, |
const char * | key, | ||
const char * | value, | ||
const char * | expires, | ||
const unsigned int | max_age, | ||
const char * | domain, | ||
const char * | path, | ||
const int | secure, | ||
const int | http_only | ||
) |
ulfius_add_cookie_to_response add a cookie to the cookie map
response | the response to add the cookie to |
key | the cookie key |
value | the cookie value |
expires | the expiration date of the ccokie in ISO format (optional) |
max_age | the maximum age of the cookie in seconds (optional) |
domain | the domain of the cookie (optional) |
pat | the path of the cookie (optional) |
secure | wether the cookie must be secure or not (optional) |
http_only | wether the cookie must be used only for http requests or not (optional) |
ulfius_add_cookie_to_response add a cookie to the cookie map return U_OK on success
int ulfius_add_same_site_cookie_to_response | ( | struct _u_response * | response, |
const char * | key, | ||
const char * | value, | ||
const char * | expires, | ||
const unsigned int | max_age, | ||
const char * | domain, | ||
const char * | path, | ||
const int | secure, | ||
const int | http_only, | ||
const int | same_site | ||
) |
ulfius_add_same_site_cookie_to_response add a cookie to the cookie map with a SameSite attribute
response | the response to add the cookie to |
key | the cookie key |
value | the cookie value |
expires | the expiration date of the ccokie in ISO format (optional) |
max_age | the maximum age of the cookie in seconds (optional) |
domain | the domain of the cookie (optional) |
pat | the path of the cookie (optional) |
secure | wether the cookie must be secure or not (optional) |
http_only | wether the cookie must be used only for http requests or not (optional) |
same_site | parameter must have one of the following values:
|
ulfius_add_same_site_cookie_to_response add a cookie to the cookie map with a SameSite attribute the same_site parameter must have one of the following values: