Cookie class

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.

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.fromSetCookieValue(String value)
Creates a new cookie by parsing a header value from a 'set-cookie' header.

Instance Properties

name String
read / write
Gets and sets the name.
value String
read / write
Gets and sets the value.
expires DateTime
read / write
Gets and sets the expiry date.
maxAge int
read / write
Gets and sets the max age. A value of 0 means delete cookie now.
domain String
read / write
Gets and sets the domain.
path String
read / write
Gets and sets the path.
secure bool
read / write
Gets and sets whether this cookie is secure.
httpOnly bool
read / write
Gets and sets whether this cookie is HTTP only.

Instance Methods

toString() → String
Returns the formatted string representation of the cookie. The string representation can be used for for setting the Cookie or 'set-cookie' headers