Find cookies matching requests.
More...
Find cookies matching requests.
◆ cookie_jar_get_cookies()
cookie_match_t * cookie_jar_get_cookies |
( |
cookie_jar_t * | jar, |
|
|
const char * | domain, |
|
|
const char * | path, |
|
|
bool | secure_only, |
|
|
bool | include_http_only ) |
Get cookies matching domain and path.
- Parameters
-
jar | Cookie jar |
domain | Request domain |
path | Request path |
secure_only | Only include cookies that work over HTTPS |
include_http_only | Include HttpOnly cookies |
- Returns
- Linked list of matching cookies
◆ cookie_jar_get_cookies_for_url()
Get cookies that match a URL.
- Parameters
-
jar | Cookie jar |
url | Request URL |
include_http_only | Include HttpOnly cookies |
- Returns
- Linked list of matching cookies (caller must free with cookie_match_free)
"https://example.com/api", true);
if (header) {
printf("Cookie: %s\n", header);
free(header);
}
char * cookie_match_to_header(const cookie_match_t *matches)
Convert cookie matches to HTTP Cookie header.
Definition cookie.c:1746
cookie_match_t * cookie_jar_get_cookies_for_url(cookie_jar_t *jar, const char *url, bool include_http_only)
Get cookies that match a URL.
Definition cookie.c:1642
void cookie_match_free(cookie_match_t *matches)
Free a list of cookie matches.
Definition cookie.c:1738
Cookie match result.
Definition cookie.h:228
◆ cookie_match_free()
Free a list of cookie matches.
- Parameters
-
matches | Cookie match list to free |
◆ cookie_match_to_header()
Convert cookie matches to HTTP Cookie header.
- Parameters
-
- Returns
- Cookie header string (caller must free), or NULL if no matches
if (cookie_header) {
free(cookie_header);
}