Dart Documentationchrome.cookiesCookie

Cookie class

Represents information about an HTTP cookie.

class Cookie extends ChromeObject {
 Cookie({String name, String value, String domain, bool hostOnly, String path, bool secure, bool httpOnly, bool session, var expirationDate, String storeId}) {
   if (name != null) this.name = name;
   if (value != null) this.value = value;
   if (domain != null) this.domain = domain;
   if (hostOnly != null) this.hostOnly = hostOnly;
   if (path != null) this.path = path;
   if (secure != null) this.secure = secure;
   if (httpOnly != null) this.httpOnly = httpOnly;
   if (session != null) this.session = session;
   if (expirationDate != null) this.expirationDate = expirationDate;
   if (storeId != null) this.storeId = storeId;
 }
 Cookie.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy);

 /**
  * The name of the cookie.
  */
 String get name => jsProxy['name'];
 set name(String value) => jsProxy['name'] = value;

 /**
  * The value of the cookie.
  */
 String get value => jsProxy['value'];
 set value(String value) => jsProxy['value'] = value;

 /**
  * The domain of the cookie (e.g. "www.google.com", "example.com").
  */
 String get domain => jsProxy['domain'];
 set domain(String value) => jsProxy['domain'] = value;

 /**
  * True if the cookie is a host-only cookie (i.e. a request's host must
  * exactly match the domain of the cookie).
  */
 bool get hostOnly => jsProxy['hostOnly'];
 set hostOnly(bool value) => jsProxy['hostOnly'] = value;

 /**
  * The path of the cookie.
  */
 String get path => jsProxy['path'];
 set path(String value) => jsProxy['path'] = value;

 /**
  * True if the cookie is marked as Secure (i.e. its scope is limited to secure
  * channels, typically HTTPS).
  */
 bool get secure => jsProxy['secure'];
 set secure(bool value) => jsProxy['secure'] = value;

 /**
  * True if the cookie is marked as HttpOnly (i.e. the cookie is inaccessible
  * to client-side scripts).
  */
 bool get httpOnly => jsProxy['httpOnly'];
 set httpOnly(bool value) => jsProxy['httpOnly'] = value;

 /**
  * True if the cookie is a session cookie, as opposed to a persistent cookie
  * with an expiration date.
  */
 bool get session => jsProxy['session'];
 set session(bool value) => jsProxy['session'] = value;

 /**
  * The expiration date of the cookie as the number of seconds since the UNIX
  * epoch. Not provided for session cookies.
  */
 dynamic get expirationDate => jsProxy['expirationDate'];
 set expirationDate(var value) => jsProxy['expirationDate'] = jsify(value);

 /**
  * The ID of the cookie store containing this cookie, as provided in
  * getAllCookieStores().
  */
 String get storeId => jsProxy['storeId'];
 set storeId(String value) => jsProxy['storeId'] = value;
}

Extends

ChromeObject > Cookie

Constructors

new Cookie({String name, String value, String domain, bool hostOnly, String path, bool secure, bool httpOnly, bool session, expirationDate, String storeId}) #

Create a new instance of a ChromeObject, which creates and delegates to a JsObject proxy.

docs inherited from ChromeObject
Cookie({String name, String value, String domain, bool hostOnly, String path, bool secure, bool httpOnly, bool session, var expirationDate, String storeId}) {
 if (name != null) this.name = name;
 if (value != null) this.value = value;
 if (domain != null) this.domain = domain;
 if (hostOnly != null) this.hostOnly = hostOnly;
 if (path != null) this.path = path;
 if (secure != null) this.secure = secure;
 if (httpOnly != null) this.httpOnly = httpOnly;
 if (session != null) this.session = session;
 if (expirationDate != null) this.expirationDate = expirationDate;
 if (storeId != null) this.storeId = storeId;
}

new Cookie.fromProxy(JsObject jsProxy) #

Create a new instance of a ChromeObject, which delegates to the given JsObject proxy.

docs inherited from ChromeObject
Cookie.fromProxy(JsObject jsProxy): super.fromProxy(jsProxy);

Properties

String domain #

The domain of the cookie (e.g. "www.google.com", "example.com").

String get domain => jsProxy['domain'];
set domain(String value) => jsProxy['domain'] = value;

var expirationDate #

The expiration date of the cookie as the number of seconds since the UNIX epoch. Not provided for session cookies.

dynamic get expirationDate => jsProxy['expirationDate'];
set expirationDate(var value) => jsProxy['expirationDate'] = jsify(value);

bool hostOnly #

True if the cookie is a host-only cookie (i.e. a request's host must exactly match the domain of the cookie).

bool get hostOnly => jsProxy['hostOnly'];
set hostOnly(bool value) => jsProxy['hostOnly'] = value;

bool httpOnly #

True if the cookie is marked as HttpOnly (i.e. the cookie is inaccessible to client-side scripts).

bool get httpOnly => jsProxy['httpOnly'];
set httpOnly(bool value) => jsProxy['httpOnly'] = value;

final jsProxy #

inherited from ChromeObject
final dynamic jsProxy

String name #

The name of the cookie.

String get name => jsProxy['name'];
set name(String value) => jsProxy['name'] = value;

String path #

The path of the cookie.

String get path => jsProxy['path'];
set path(String value) => jsProxy['path'] = value;

bool secure #

True if the cookie is marked as Secure (i.e. its scope is limited to secure channels, typically HTTPS).

bool get secure => jsProxy['secure'];
set secure(bool value) => jsProxy['secure'] = value;

bool session #

True if the cookie is a session cookie, as opposed to a persistent cookie with an expiration date.

bool get session => jsProxy['session'];
set session(bool value) => jsProxy['session'] = value;

String storeId #

The ID of the cookie store containing this cookie, as provided in getAllCookieStores().

String get storeId => jsProxy['storeId'];
set storeId(String value) => jsProxy['storeId'] = value;

String value #

The value of the cookie.

String get value => jsProxy['value'];
set value(String value) => jsProxy['value'] = value;

Methods

JsObject toJs() #

inherited from ChromeObject
JsObject toJs() => jsProxy;

String toString() #

inherited from ChromeObject

Returns a string representation of this object.

docs inherited from Object
String toString() => jsProxy.toString();