Skip to main content

getCookies

Retrieves all cookies for the current domain as a list. Each cookie is returned as a map having separate entries for every field in cookie.

getCookies()

Returns#

  • A list of cookies or empty list if none found. Each cookie in list is represented by a map having separate entries for every field in cookie. Following describes keys and the corresponding values:
    • name: Name of cookie as string
    • value: Value of cookie as string
    • path: Path of cookie as string
    • domain: Host name of cookie as string
    • expiry: Remaining cookie expiration time in milliseconds
    • secure: boolean indicating secure status of cookie
    • httpOnly: boolean indicating httpOnly status of cookie

Example#

allCookies = getCookies()print(allCookies)/*Prints following:[  {    name: my-cookie,    value: 1199,    path: /,    domain: example.com,    expiry: 3600000,    secure: true,    httpOnly: false  },  {    name: user-cookie,    value: 1,    path: /,    domain: example.com,    expiry: 3600000,    secure: true,    httpOnly: false  }]*/