Dart API Referencedart:ioCookie

Cookie Interface

Representation of a cookie. For cookies received by the server as Cookie header values only name and value fields will be set. When building a cookie for the Set-Cookie header in the server and when receiving cookies in the client as Set-Cookie headers all fields can be used.

Constructors

Creates a new cookie optionally setting the name and value.

Cookie([String name, String value]);

Creates a new cookie by parsing a header value from a Set-Cookie header.

Cookie.fromSetCookieValue(String value);

Methods

Code String toString() #

Returns the formatted string representation of the cookie. The string representation can be used for for setting the Cookie or Set-Cookie headers

String toString();

Fields

Code String domain #

Gets and sets the domain.

String domain;

Code Date expires #

Gets and sets the expiry date.

Date expires;

Code bool httpOnly #

Gets and sets whether this cookie is HTTP only.

bool httpOnly;

Code int maxAge #

Gets and sets the max age. A value of 0 means delete cookie now.

int maxAge;

Code String name #

Gets and sets the name.

String name;

Code String path #

Gets and sets the path.

String path;

Code bool secure #

Gets and sets whether this cookie is secure.

bool secure;

Code String value #

Gets and sets the value.

String value;