Object - http : Cookie

Represents a Cookie.

Constructor

__init

(string name, string value)

  • name string
  • Name of the Cookie

  • value string
  • Value of the Cookie

Methods

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)
  • set to false if the cookie will be discarded at the end of the "session". Else, returns true.

isValid

()

returns boolean | InvalidCookieError

Checks the validity of the attributes of the cookie.

  • Return Type

    (boolean | InvalidCookieError)
  • set to true if the attributes of the cookie are in the correct format. Otherwise, returns an error.