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
listof cookies or emptylistif none found. Each cookie inlistis represented by amaphaving separate entries for every field in cookie. Following describes keys and the corresponding values:name: Name of cookie asstringvalue: Value of cookie asstringpath: Path of cookie asstringdomain: Host name of cookie asstringexpiry: Remaining cookie expiration time in millisecondssecure:booleanindicatingsecurestatus of cookiehttpOnly:booleanindicatinghttpOnlystatus 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 }]*/