W3cubDocs

/Dart 2

Cookie class

Representation of a cookie. For cookies received by the server as Cookie header values only name and value properties 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 setting the name and value. [...]
Cookie.fromSetCookieValue(String value)
factory
Creates a new cookie by parsing a header value from a 'set-cookie' header.

Properties

domainString
read / write
The domain the cookie applies to.
expiresDateTime
read / write
The time at which the cookie expires.
httpOnlybool
read / write
Whether the cookie is only sent in the HTTP request and is not made available to client side scripts.
maxAgeint
read / write
The number of seconds until the cookie expires. A zero or negative value means the cookie has expired.
nameString
read / write
The name of the cookie. [...]
pathString
read / write
The path within the domain the cookie applies to.
securebool
read / write
Whether to only send this cookie on secure connections.
valueString
read / write
The value of the cookie. [...]
hashCodeint
read-only, inherited
The hash code for this object. [...]
runtimeTypeType
read-only, inherited
A representation of the runtime type of the object.

Methods

toString() → String
override
Returns the formatted string representation of the cookie. The string representation can be used for for setting the Cookie or 'set-cookie' headers
noSuchMethod(Invocation invocation) → dynamic
inherited
Invoked when a non-existent method or property is accessed. [...]

Operators

operator ==(dynamic other) → bool
inherited
The equality operator. [...]

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.5.0/dart-io/Cookie-class.html