CookieManager

The WebKitCookieManager defines how to set up and handle cookies. You can get it from a #WebKitWebsiteDataManager with webkit_website_data_manager_get_cookie_manager(), and use it to set where to store cookies with webkit_cookie_manager_set_persistent_storage(), or to set the acceptance policy, with webkit_cookie_manager_get_accept_policy().

Constructors

this
this(WebKitCookieManager* webKitCookieManager, bool ownedRef)

Sets our main struct and passes it to the parent class.

Members

Functions

addCookie
void addCookie(Cookie cookie, Cancellable cancellable, GAsyncReadyCallback callback, void* userData)

Asynchronously add a #SoupCookie to the underlying storage.

addCookieFinish
bool addCookieFinish(AsyncResultIF result)

Finish an asynchronous operation started with webkit_cookie_manager_add_cookie().

addOnChanged
gulong addOnChanged(void delegate(CookieManager) dlg, ConnectFlags connectFlags)

This signal is emitted when cookies are added, removed or modified.

deleteAllCookies
void deleteAllCookies()

Delete all cookies of @cookie_manager

deleteCookie
void deleteCookie(Cookie cookie, Cancellable cancellable, GAsyncReadyCallback callback, void* userData)

Asynchronously delete a #SoupCookie from the current session.

deleteCookieFinish
bool deleteCookieFinish(AsyncResultIF result)

Finish an asynchronous operation started with webkit_cookie_manager_delete_cookie().

deleteCookiesForDomain
void deleteCookiesForDomain(string domain)

Remove all cookies of @cookie_manager for the given @domain.

getAcceptPolicy
void getAcceptPolicy(Cancellable cancellable, GAsyncReadyCallback callback, void* userData)

Asynchronously get the cookie acceptance policy of @cookie_manager. Note that when policy was set to %WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY and ITP is enabled, this will return %WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS. See also webkit_website_data_manager_set_itp_enabled().

getAcceptPolicyFinish
WebKitCookieAcceptPolicy getAcceptPolicyFinish(AsyncResultIF result)

Finish an asynchronous operation started with webkit_cookie_manager_get_accept_policy().

getCookieManagerStruct
WebKitCookieManager* getCookieManagerStruct(bool transferOwnership)

Get the main Gtk struct

getCookies
void getCookies(string uri, Cancellable cancellable, GAsyncReadyCallback callback, void* userData)

Asynchronously get a list of #SoupCookie from @cookie_manager associated with @uri, which must be either an HTTP or an HTTPS URL.

getCookiesFinish
ListG getCookiesFinish(AsyncResultIF result)

Finish an asynchronous operation started with webkit_cookie_manager_get_cookies(). The return value is a #GSList of #SoupCookie instances which should be released with g_list_free_full() and soup_cookie_free().

getDomainsWithCookies
void getDomainsWithCookies(Cancellable cancellable, GAsyncReadyCallback callback, void* userData)

Asynchronously get the list of domains for which @cookie_manager contains cookies.

getDomainsWithCookiesFinish
string[] getDomainsWithCookiesFinish(AsyncResultIF result)

Finish an asynchronous operation started with webkit_cookie_manager_get_domains_with_cookies(). The return value is a %NULL terminated list of strings which should be released with g_strfreev().

getStruct
void* getStruct()

the main Gtk struct as a void*

setAcceptPolicy
void setAcceptPolicy(WebKitCookieAcceptPolicy policy)

Set the cookie acceptance policy of @cookie_manager as @policy. Note that ITP has its own way to handle third-party cookies, so when it's enabled, and @policy is set to %WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY, %WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS will be used instead. Once disabled, the policy will be set back to %WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY. See also webkit_website_data_manager_set_itp_enabled().

setPersistentStorage
void setPersistentStorage(string filename, WebKitCookiePersistentStorage storage)

Set the @filename where non-session cookies are stored persistently using @storage as the format to read/write the cookies. Cookies are initially read from @filename to create an initial set of cookies. Then, non-session cookies will be written to @filename when the WebKitCookieManager::changed signal is emitted. By default, @cookie_manager doesn't store the cookies persistently, so you need to call this method to keep cookies saved across sessions.

Static functions

getType
GType getType()

Variables

webKitCookieManager
WebKitCookieManager* webKitCookieManager;

the main Gtk struct

Meta