NetSurf
Data Structures | Enumerations | Functions
cookie_db.h File Reference

Unified cookie database public interface. More...

#include <stdbool.h>
#include <time.h>
Include dependency graph for cookie_db.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  cookie_data
 

Enumerations

enum  cookie_version { COOKIE_NETSCAPE = 0 , COOKIE_RFC2109 = 1 , COOKIE_RFC2965 = 2 }
 Version of cookie. More...
 

Functions

void urldb_iterate_cookies (bool(*callback)(const struct cookie_data *cookie))
 Iterate over all cookies in database. More...
 
void urldb_delete_cookie (const char *domain, const char *path, const char *name)
 Delete a cookie. More...
 
void urldb_load_cookies (const char *filename)
 Load a cookie file into the database. More...
 
void urldb_save_cookies (const char *filename)
 Save persistent cookies to file. More...
 

Detailed Description

Unified cookie database public interface.

Definition in file cookie_db.h.

Enumeration Type Documentation

◆ cookie_version

Version of cookie.

RFC2109 and RFC2965 "HTTP State Management Mechanism" defined alternative versions of cookies. Nothing used them and these RFC are now obsoleted by RFC6265 which completely removes the alternative versions.

Enumerator
COOKIE_NETSCAPE 
COOKIE_RFC2109 
COOKIE_RFC2965 

Definition at line 38 of file cookie_db.h.

Function Documentation

◆ urldb_delete_cookie()

void urldb_delete_cookie ( const char *  domain,
const char *  path,
const char *  name 
)

Delete a cookie.

Parameters
domainThe cookie's domain
pathThe cookie's path
nameThe cookie's name

Definition at line 4273 of file urldb.c.

References db_root, cookie_internal_data::domain, cookie_internal_data::name, path(), and urldb_delete_cookie_hosts().

Referenced by CookieWindow::_DeleteCookies(), and cookie_manager_delete_entry().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ urldb_iterate_cookies()

void urldb_iterate_cookies ( bool(*)(const struct cookie_data *cookie)  callback)

Iterate over all cookies in database.

Parameters
callbackFunction to callback for each entry

Referenced by CookieWindow::_DeleteCookies(), cookie_manager_init(), and nsbeos_cookies_init().

Here is the caller graph for this function:

◆ urldb_load_cookies()

void urldb_load_cookies ( const char *  filename)

Load a cookie file into the database.

Parameters
filenameFile to load

Definition at line 4281 of file urldb.c.

References cookie_internal_data::comment, cookie_internal_data::domain, cookie_internal_data::domain_from_set, cookie_internal_data::expires, FIND_T, cookie_internal_data::http_only, cookie_internal_data::last_used, loaded_cookie_file_version, MIN_COOKIE_FILE_VERSION, cookie_internal_data::name, cookie_internal_data::no_destroy, NSERROR_OK, NSLOG, nsurl_create(), nsurl_get_component(), NSURL_SCHEME, nsurl_unref(), cookie_internal_data::path, path(), cookie_internal_data::path_from_set, cookie_internal_data::secure, SKIP_T, urldb_free_cookie(), urldb_insert_cookie(), cookie_internal_data::value, cookie_internal_data::value_was_quoted, cookie_internal_data::version, and version.

Referenced by gui_init(), main(), nsgtk_setup(), and WinMain().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ urldb_save_cookies()

void urldb_save_cookies ( const char *  filename)

Save persistent cookies to file.

Parameters
filenamePath to save to

Definition at line 4448 of file urldb.c.

References COOKIE_FILE_VERSION, db_root, loaded_cookie_file_version, max, and urldb_save_cookie_hosts().

Referenced by gui_quit(), monkey_quit(), nsgtk_finalise(), and WinMain().

Here is the call graph for this function:
Here is the caller graph for this function: