1.9 <WebKitCookieManager>

Class: <WebKitCookieManager>

It derives from <GObject>.

Defines how to handle cookies in a <WebKitWebContext>.

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 cookie-manager:set-persistent-storage, or to set the acceptance policy, with cookie-manager:get-accept-policy.

Procedures

Method: add-cookie self cookie [cancellable] [callback]

Asynchronously add a <SoupCookie> to the underlying storage.

When the operation is finished, callback will be called. You can then call cookie-manager:add-cookie-finish? to get the result of the operation.

self

Passed: a <WebKitCookieManager>.

a <WebKitCookieManager>

cookie

Passed: a <SoupCookie>.

the <SoupCookie> to be added

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable> or #f to ignore

callback

Passed, or left out: a procedure, or #f.

a GAsyncReadyCallback to call when the request is satisfied

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

the data to pass to callback function

Method: add-cookie-finish? self result ⇒ %return

Finish an asynchronous operation started with cookie-manager:add-cookie.

self

Passed: a <WebKitCookieManager>.

a <WebKitCookieManager>

result

Passed: a <GAsyncResult>.

a <GAsyncResult>

%return

Returned: a boolean.

#t if the cookie was added or #f in case of error.

Method: delete-cookie self cookie [cancellable] [callback]

Asynchronously delete a <SoupCookie> from the current session.

When the operation is finished, callback will be called. You can then call cookie-manager:delete-cookie-finish? to get the result of the operation.

self

Passed: a <WebKitCookieManager>.

a <WebKitCookieManager>

cookie

Passed: a <SoupCookie>.

the <SoupCookie> to be deleted

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable> or #f to ignore

callback

Passed, or left out: a procedure, or #f.

a GAsyncReadyCallback to call when the request is satisfied

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

the data to pass to callback function

Method: delete-cookie-finish? self result ⇒ %return

Finish an asynchronous operation started with cookie-manager:delete-cookie.

self

Passed: a <WebKitCookieManager>.

a <WebKitCookieManager>

result

Passed: a <GAsyncResult>.

a <GAsyncResult>

%return

Returned: a boolean.

#t if the cookie was deleted or #f in case of error.

Method: get-accept-policy self [cancellable] [callback]

Asynchronously get the cookie acceptance policy of self.

Note that when policy was set to no-third-party and ITP is enabled, this will return always. See also webkit_website_data_manager_set_itp_enabled().

When the operation is finished, callback will be called. You can then call cookie-manager:get-accept-policy-finish to get the result of the operation.

self

Passed: a <WebKitCookieManager>.

a <WebKitCookieManager>

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable> or #f to ignore

callback

Passed, or left out: a procedure, or #f.

a GAsyncReadyCallback to call when the request is satisfied

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

the data to pass to callback function

Method: get-accept-policy-finish self result ⇒ %return

Finish an asynchronous operation started with cookie-manager:get-accept-policy.

self

Passed: a <WebKitCookieManager>.

a <WebKitCookieManager>

result

Passed: a <GAsyncResult>.

a <GAsyncResult>

%return

Returned: a <WebKitCookieAcceptPolicy>.

the cookie acceptance policy of self as a <WebKitCookieAcceptPolicy>.

Method: get-all-cookies self [cancellable] [callback]

Asynchronously get a list of <SoupCookie> from self.

When the operation is finished, callback will be called. You can then call cookie-manager:get-all-cookies-finish to get the result of the operation.

self

Passed: a <WebKitCookieManager>.

a <WebKitCookieManager>

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable> or #f to ignore

callback

Passed, or left out: a procedure, or #f.

(closure user_data): a GAsyncReadyCallback to call when the request is satisfied

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

the data to pass to callback function

Method: get-all-cookies-finish self result ⇒ %return

Finish an asynchronous operation started with cookie-manager:get-all-cookies.

The return value is a GList of <SoupCookie> instances which should be released with g_list_free_full() and cookie:free.

self

Passed: a <WebKitCookieManager>.

a <WebKitCookieManager>

result

Passed: a <GAsyncResult>.

a <GAsyncResult>

%return

Returned: a list, each a <SoupCookie>.

A GList of <SoupCookie> instances.

Method: get-cookies self uri [cancellable] [callback]

Asynchronously get a list of <SoupCookie> from self.

Asynchronously get a list of <SoupCookie> from self associated with uri, which must be either an HTTP or an HTTPS URL.

When the operation is finished, callback will be called. You can then call cookie-manager:get-cookies-finish to get the result of the operation.

self

Passed: a <WebKitCookieManager>.

a <WebKitCookieManager>

uri

Passed: a string.

the URI associated to the cookies to be retrieved

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable> or #f to ignore

callback

Passed, or left out: a procedure, or #f.

a GAsyncReadyCallback to call when the request is satisfied

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

the data to pass to callback function

Method: get-cookies-finish self result ⇒ %return

Finish an asynchronous operation started with cookie-manager:get-cookies.

The return value is a GList of <SoupCookie> instances which should be released with g_list_free_full() and cookie:free.

self

Passed: a <WebKitCookieManager>.

a <WebKitCookieManager>

result

Passed: a <GAsyncResult>.

a <GAsyncResult>

%return

Returned: a list, each a <SoupCookie>.

A GList of <SoupCookie> instances.

Method: replace-cookies self cookies [cancellable] [callback]

Asynchronously replace all cookies in self with the given list of cookies.

When the operation is finished, callback will be called. You can then call cookie-manager:replace-cookies-finish? to get the result of the operation.

self

Passed: a <WebKitCookieManager>.

a <WebKitCookieManager>

cookies

Passed: a list, each a <SoupCookie>.

a GList of <SoupCookie> to be added

cancellable

Passed, or left out: a <GCancellable>, or #f.

a <GCancellable> or #f to ignore

callback

Passed, or left out: a procedure, or #f.

(closure user_data): a GAsyncReadyCallback to call when the request is satisfied

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

the data to pass to callback function

Method: replace-cookies-finish? self result ⇒ %return

Finish an asynchronous operation started with cookie-manager:replace-cookies.

self

Passed: a <WebKitCookieManager>.

a <WebKitCookieManager>

result

Passed: a <GAsyncResult>.

a <GAsyncResult>

%return

Returned: a boolean.

#t if the cookies were added or #f in case of error.

Method: set-accept-policy self policy

Set the cookie acceptance policy of self as policy.

Note that ITP has its own way to handle third-party cookies, so when it’s enabled, and policy is set to no-third-party, always will be used instead. Once disabled, the policy will be set back to no-third-party. See also webkit_website_data_manager_set_itp_enabled().

self

Passed: a <WebKitCookieManager>.

a <WebKitCookieManager>

policy

Passed: a <WebKitCookieAcceptPolicy>, or one of its symbols.

a <WebKitCookieAcceptPolicy>

Method: set-persistent-storage self filename storage

Set non-session cookies.

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, self doesn’t store the cookies persistently, so you need to call this method to keep cookies saved across sessions.

This method should never be called on a <WebKitCookieManager> associated to an ephemeral <WebKitWebsiteDataManager>.

self

Passed: a <WebKitCookieManager>.

a <WebKitCookieManager>

filename

Passed: a string.

the filename to read to/write from

storage

Passed: a <WebKitCookiePersistentStorage>, or one of its symbols.

a <WebKitCookiePersistentStorage>

Signals

Connect a handler with (connect object cookie-manager:changed handler). It is called as (handler self).

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

self

Passed: a <WebKitCookieManager>.