Click or drag to resize
CfxCookieManager Class

[This is preliminary documentation and is subject to change.]

Structure used for managing cookies. The functions of this structure may be called on any thread unless otherwise indicated.
Inheritance Hierarchy
SystemObject
  ChromiumCfxObject
    ChromiumCfxBase
      ChromiumCfxLibraryBase
        ChromiumCfxCookieManager

Namespace: Chromium
Assembly: ChromiumFX (in ChromiumFX.dll)
Syntax
public class CfxCookieManager : CfxLibraryBase

The CfxCookieManager type exposes the following members.

Properties
  NameDescription
Public propertyNativePtr
Provides access to the underlying native cef struct. This is a refcounted library struct derived from cef_base_t. Add a ref in order to keep it alive when this managed object go out of scope.
(Inherited from CfxLibraryBase.)
Top
Methods
  NameDescription
Public methodStatic memberCreateManager
Creates a new cookie manager. If |path| is NULL data will be stored in memory only. Otherwise, data will be stored at the specified |path|. To persist session cookies (cookies without an expiry date or validity interval) set |persistSessionCookies| to true (1). Session cookies are generally intended to be transient and most Web browsers do not persist them. If |callback| is non-NULL it will be executed asnychronously on the IO thread after the manager's storage has been initialized.
Public methodDeleteCookies
Delete all cookies that match the specified parameters. If both |url| and |cookieName| values are specified all host and domain cookies matching both will be deleted. If only |url| is specified all host cookies (but not domain cookies) irrespective of path will be deleted. If |url| is NULL all cookies for all hosts and domains will be deleted. If |callback| is non- NULL it will be executed asnychronously on the IO thread after the cookies have been deleted. Returns false (0) if a non-NULL invalid URL is specified or if cookies cannot be accessed. Cookies can alternately be deleted using the Visit*Cookies() functions.
Public methodFlushStore
Flush the backing store (if any) to disk. If |callback| is non-NULL it will be executed asnychronously on the IO thread after the flush is complete. Returns false (0) if cookies cannot be accessed.
Public methodStatic memberGetGlobalManager
Returns the global cookie manager. By default data will be stored at CfxSettings.CachePath if specified or in memory otherwise. If |callback| is non-NULL it will be executed asnychronously on the IO thread after the manager's storage has been initialized. Using this function is equivalent to calling CfxRequestContext.CfxRequestContextGetGlobalContext()->get_d efault_cookie_manager().
Public methodSetCookie
Sets a cookie given a valid URL and explicit user-provided cookie attributes. This function expects each attribute to be well-formed. It will check for disallowed characters (e.g. the ';' character is disallowed within the cookie value attribute) and fail without setting the cookie if such characters are found. If |callback| is non-NULL it will be executed asnychronously on the IO thread after the cookie has been set. Returns false (0) if an invalid URL is specified or if cookies cannot be accessed.
Public methodSetStoragePath
Sets the directory path that will be used for storing cookie data. If |path| is NULL data will be stored in memory only. Otherwise, data will be stored at the specified |path|. To persist session cookies (cookies without an expiry date or validity interval) set |persistSessionCookies| to true (1). Session cookies are generally intended to be transient and most Web browsers do not persist them. If |callback| is non-NULL it will be executed asnychronously on the IO thread after the manager's storage has been initialized. Returns false (0) if cookies cannot be accessed.
Public methodSetSupportedSchemes
Set the schemes supported by this manager. The default schemes ("http", "https", "ws" and "wss") will always be supported. If |callback| is non- NULL it will be executed asnychronously on the IO thread after the change has been applied. Must be called before any cookies are accessed.
Public methodVisitAllCookies
Visit all cookies on the IO thread. The returned cookies are ordered by longest path, then by earliest creation date. Returns false (0) if cookies cannot be accessed.
Public methodVisitUrlCookies
Visit a subset of cookies on the IO thread. The results are filtered by the given url scheme, host, domain and path. If |includeHttpOnly| is true (1) HTTP-only cookies will also be included in the results. The returned cookies are ordered by longest path, then by earliest creation date. Returns false (0) if cookies cannot be accessed.
Top
Remarks
See also the original CEF documentation in cef/include/capi/cef_cookie_capi.h.
See Also