Chromium Embedded Framework (CEF)  130.1.2+g48f3ef6+chromium-130.0.6723.44
CefCookieManager Class Referenceabstract

Class used for managing cookies. More...

#include "include/cef_cookie.h"

Inheritance diagram for CefCookieManager:
CefBaseRefCounted

Public Member Functions

virtual bool VisitAllCookies (CefRefPtr< CefCookieVisitor > visitor)=0
 Visit all cookies on the UI thread. More...
 
virtual bool VisitUrlCookies (const CefString &url, bool includeHttpOnly, CefRefPtr< CefCookieVisitor > visitor)=0
 Visit a subset of cookies on the UI thread. More...
 
virtual bool SetCookie (const CefString &url, const CefCookie &cookie, CefRefPtr< CefSetCookieCallback > callback)=0
 Sets a cookie given a valid URL and explicit user-provided cookie attributes. More...
 
virtual bool DeleteCookies (const CefString &url, const CefString &cookie_name, CefRefPtr< CefDeleteCookiesCallback > callback)=0
 Delete all cookies that match the specified parameters. More...
 
virtual bool FlushStore (CefRefPtr< CefCompletionCallback > callback)=0
 Flush the backing store (if any) to disk. More...
 
- Public Member Functions inherited from CefBaseRefCounted
virtual void AddRef () const =0
 Called to increment the reference count for the object. More...
 
virtual bool Release () const =0
 Called to decrement the reference count for the object. More...
 
virtual bool HasOneRef () const =0
 Returns true if the reference count is 1. More...
 
virtual bool HasAtLeastOneRef () const =0
 Returns true if the reference count is at least 1. More...
 

Static Public Member Functions

static CefRefPtr< CefCookieManagerGetGlobalManager (CefRefPtr< CefCompletionCallback > callback)
 Returns the global cookie manager. More...
 

Additional Inherited Members

- Protected Member Functions inherited from CefBaseRefCounted
virtual ~CefBaseRefCounted ()
 

Detailed Description

Class used for managing cookies.

The methods of this class may be called on any thread unless otherwise indicated.

Member Function Documentation

◆ DeleteCookies()

virtual bool CefCookieManager::DeleteCookies ( const CefString url,
const CefString cookie_name,
CefRefPtr< CefDeleteCookiesCallback callback 
)
pure virtual

Delete all cookies that match the specified parameters.

If both |url| and |cookie_name| 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 empty all cookies for all hosts and domains will be deleted. If |callback| is non-NULL it will be executed asnychronously on the UI thread after the cookies have been deleted. Returns false if a non-empty invalid URL is specified or if cookies cannot be accessed. Cookies can alternately be deleted using the Visit*Cookies() methods.

◆ FlushStore()

virtual bool CefCookieManager::FlushStore ( CefRefPtr< CefCompletionCallback callback)
pure virtual

Flush the backing store (if any) to disk.

If |callback| is non-NULL it will be executed asnychronously on the UI thread after the flush is complete. Returns false if cookies cannot be accessed.

◆ GetGlobalManager()

static CefRefPtr<CefCookieManager> CefCookieManager::GetGlobalManager ( CefRefPtr< CefCompletionCallback callback)
static

Returns the global cookie manager.

By default data will be stored at cef_settings_t.cache_path if specified or in memory otherwise. If |callback| is non-NULL it will be executed asnychronously on the UI thread after the manager's storage has been initialized. Using this method is equivalent to calling CefRequestContext::GetGlobalContext()->GetDefaultCookieManager().

◆ SetCookie()

virtual bool CefCookieManager::SetCookie ( const CefString url,
const CefCookie cookie,
CefRefPtr< CefSetCookieCallback callback 
)
pure virtual

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 UI thread after the cookie has been set. Returns false if an invalid URL is specified or if cookies cannot be accessed.

◆ VisitAllCookies()

virtual bool CefCookieManager::VisitAllCookies ( CefRefPtr< CefCookieVisitor visitor)
pure virtual

Visit all cookies on the UI thread.

The returned cookies are ordered by longest path, then by earliest creation date. Returns false if cookies cannot be accessed.

◆ VisitUrlCookies()

virtual bool CefCookieManager::VisitUrlCookies ( const CefString url,
bool  includeHttpOnly,
CefRefPtr< CefCookieVisitor visitor 
)
pure virtual

Visit a subset of cookies on the UI thread.

The results are filtered by the given url scheme, host, domain and path. If |includeHttpOnly| is true 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 if cookies cannot be accessed.


The documentation for this class was generated from the following file: