Object - http : Cookie

Represents a Cookie.

Constructor

__init

(string name, string value)

  • name string
  • Name of the http:Cookie

  • value string
  • Value of the http:Cookie

Methods

Checks the persistance of the cookie.

Checks the validity of the attributes of the cookie.

Fields

  • name string? (default ())
  • Name of the cookie

  • value string? (default ())
  • Value of the cookie

  • domain string? (default ())
  • Host to which the cookie will be sent

  • path string? (default ())
  • URI path to which the cookie belongs

  • expires string? (default ())
  • Maximum lifetime of the cookie represented as the date and time at which the cookie expires

  • maxAge int (default 0)
  • Maximum lifetime of the cookie represented as the number of seconds until the cookie expires

  • httpOnly boolean (default false)
  • Cookie is sent only to HTTP requests

  • secure boolean (default false)
  • Cookie is sent only to secure channels

  • createdTime Time (default time:currentTime())
  • At what time the cookie was created

  • lastAccessedTime Time (default time:currentTime())
  • Last-accessed time of the cookie

  • hostOnly boolean (default false)
  • Cookie is sent only to the requested host

isPersistent

()

returns boolean

Checks the persistance of the cookie.

  • Return Type

    (boolean)
  • false if the cookie will be discarded at the end of the "session" or else true.

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