Functions for HTTP cookie handling.
More...
Functions for HTTP cookie handling.
◆ fetch_cookie_jar_clear()
void fetch_cookie_jar_clear |
( |
void | | ) |
|
Clear all cookies from the jar.
◆ fetch_cookie_jar_count()
size_t fetch_cookie_jar_count |
( |
const char * | domain_filter | ) |
|
Count cookies in the jar.
- Parameters
-
domain_filter | Optional domain filter (NULL for all cookies) |
- Returns
- Number of cookies
printf("Total cookies: %zu, Google cookies: %zu\n", total, google);
size_t fetch_cookie_jar_count(const char *domain_filter)
Count cookies in the jar.
Definition fetch.c:8933
◆ fetch_cookie_jar_free()
Free a cookie jar.
- Parameters
-
- Note
- Memory: Frees the cookie jar and all contained cookies
◆ fetch_cookie_jar_print()
void fetch_cookie_jar_print |
( |
cookie_jar_t * | jar, |
|
|
const char * | domain_filter ) |
Print cookies to stdout (for debugging)
- Parameters
-
jar | Cookie jar to print |
domain_filter | Optional domain filter (NULL for all) |
◆ fetch_create_cookie_jar()
cookie_jar_t * fetch_create_cookie_jar |
( |
const char * | persistent_file | ) |
|
Create a new cookie jar.
- Parameters
-
persistent_file | Optional file for persistent storage (NULL for memory-only) |
- Returns
- New cookie jar (caller owns, must call fetch_cookie_jar_free()), or NULL on failure
- Note
- Memory: Returns owned cookie jar that must be freed
if (!jar) {
fprintf(stderr, "Failed to create cookie jar\n");
return -1;
}
if (persistent_jar) {
}
cookie_jar_t * fetch_create_cookie_jar(const char *persistent_file)
Create a new cookie jar.
Definition fetch.c:8962
void fetch_cookie_jar_free(cookie_jar_t *jar)
Free a cookie jar.
Definition fetch.c:8982
Cookie jar implementation.
Definition cookie.h:184
◆ fetch_disable_cookies()
void fetch_disable_cookies |
( |
void | | ) |
|
Disable cookie handling.
Removes the cookie jar and disables cookie processing.
◆ fetch_get_cookie_jar()
Get the current cookie jar.
- Returns
- Cookie jar (owned by library, do not free), or NULL if cookies disabled
- Note
- Memory: Cookie jar is owned by the library
◆ fetch_load_cookies()
bool fetch_load_cookies |
( |
const char * | filename, |
|
|
cookie_jar_t * | jar ) |
Load cookies from a file.
- Parameters
-
filename | File path to load from |
jar | Cookie jar to load into |
- Returns
- true if successful
◆ fetch_save_cookies()
bool fetch_save_cookies |
( |
const char * | filename, |
|
|
cookie_jar_t * | jar ) |
Save cookies to a file.
- Parameters
-
filename | File path to save to |
jar | Cookie jar to save |
- Returns
- true if successful