Skip to main content

getNamedCookie

Retrieves cookie for the current domain by given name.

getNamedCookie(name)

Parameters#

  • name: Name of the cookie

Returns#

  • A map representing the cookie or no value if it's not found. Following describes keys and the corresponding values in cookie map:
    • 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#

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