Skip to content

Latest commit

 

History

History
117 lines (87 loc) · 3.11 KB

File metadata and controls

117 lines (87 loc) · 3.11 KB

Project will move to github. Find this wiki page at the new address: https://github.com/cztomczak/cefpython/wiki/Cookie


Cookie class

See also CookieManager.SetCookie() and CookieVisitor.Visit().

CEF 1, CEF 3

void Set(dict cookie)

Set cookie properties via a dict.

The cookie may have the following keys:

- name (str)
- value (str)
- domain (str)
- path (str)
- secure (bool)
- httpOnly (bool)
- creation (datetime.datetime)
- lastAccess (datetime.datetime)
- hasExpires (bool)
- expires (datetime.datetime)

dict Get()

Get all cookie properties as a dict.

void SetName(string name)

Set the cookie name.

string GetName()

Get the cookie name.

void SetValue(string value)

Set the cookie value.

string GetValue()

Get the cookie value.

void SetDomain(string domain)

If |domain| is empty a host cookie will be
created instead of a domain cookie. Domain cookies are stored with a
leading "." and are visible to sub-domains whereas host cookies are
not.

string GetDomain()

Get the cookie domain.

void SetPath(string path)

If |path| is non-empty only URLs at or below the path will get the
cookie value.

string GetPath()

Get the cookie path.

void SetSecure(bool secure)

If |secure| is true the cookie will only be sent for HTTPS requests.

bool GetSecure()

Get the secure property.

void SetHttpOnly(bool httpOnly)

If |httponly| is true the cookie will only be sent for HTTP requests.

bool GetHttpOnly()

Get the httpOnly property.

void SetCreation(datetime.datetime creation)

The cookie creation date. This is automatically populated by the system on
cookie creation.

datetime.datetime GetCreation()

Get the creation property.

void SetLastAccess(datetime.datetime lastAccess)

The cookie last access date. This is automatically populated by the system
on access.

datetime.datetime GetLastAccess()

Get the lastAccess property.

void SetHasExpires(bool hasExpires)

The cookie expiration date is only valid if |hasExpires| is true.

bool GetHasExpires()

Get the hasExpires property.

void SetExpires(datetime.datetime expires)

Set the cookie expiration date. You should also call SetHasExpires().

datetime.datetime GetExpires()

Get the expires property.