Class: Cookie
Represents a Cookie.
Constructor
Initializes the http:Cookie
object.
init (string name, string value, *CookieOptions options)
- name string
Name of the
http:Cookie
- value string
Value of the
http:Cookie
- options *CookieOptions
The options to be used when initializing the
http:Cookie
Methods
isPersistent | Checks the persistence of the cookie. |
isValid | Checks the validity of the attributes of the cookie. |
toStringValue | Gets the Cookie object in its string representation to be used in the ‘Set-Cookie’ header of the response. |
Fields
- name string
- value string
- path string?
- domain string?
- expires string?
- maxAge int
- httpOnly boolean
- secure boolean
- createdTime Utc
- lastAccessedTime Utc
- hostOnly boolean
Name of the cookie
Value of the cookie
URI path to which the cookie belongs
Host to which the cookie will be sent
Maximum lifetime of the cookie represented as the date and time at which the cookie expires
Maximum lifetime of the cookie represented as the number of seconds until the cookie expires
Cookie is sent only to HTTP requests
Cookie is sent only to secure channels
At what time the cookie was created
Last-accessed time of the cookie
Cookie is sent only to the requested host
isValid
function isValid() returns boolean | InvalidCookieError
Checks the validity of the attributes of the cookie.
Return Type
(boolean | InvalidCookieError)true
if the attributes of the cookie are in the correct format or else an http:InvalidCookieError