Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
n_cookies.h File Reference

Domain-aware HTTP cookie jar: Set-Cookie parsing and Cookie header building. More...

#include "nilorea/n_list.h"
#include "nilorea/n_str.h"
#include <pthread.h>
+ Include dependency graph for n_cookies.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  N_COOKIE
 a single stored cookie More...
 
struct  N_COOKIE_JAR
 a thread-safe cookie jar More...
 

Functions

void n_cookiejar_add_from_header (N_COOKIE_JAR *jar, const char *set_cookie_value, const char *request_domain)
 parse one Set-Cookie value (without the "Set-Cookie:" name) and store it; request_domain/path supply the defaults
 
N_STRn_cookiejar_build_header (N_COOKIE_JAR *jar, const char *domain, const char *path, int is_secure)
 build a "name=value; name2=value2" Cookie header value for a request (domain/path/secure/expiry matched); free with free_nstr.
 
void n_cookiejar_clear (N_COOKIE_JAR *jar)
 drop every stored cookie
 
size_t n_cookiejar_count (N_COOKIE_JAR *jar)
 number of cookies currently stored
 
void n_cookiejar_free (N_COOKIE_JAR **jar)
 free a cookie jar and all its cookies, then NULL the pointer
 
N_COOKIE_JARn_cookiejar_new (void)
 create an empty cookie jar; free with n_cookiejar_free.
 

Detailed Description

Domain-aware HTTP cookie jar: Set-Cookie parsing and Cookie header building.

Author
Castagnier Mickael
Version
1.0

Definition in file n_cookies.h.