cookies.getAll()

Retrieves all cookies from a single cookie store that match the given information. The cookies returned will be sorted, with those with the longest path first. If multiple cookies have the same path length, those with the earliest creation time will be first.

Syntax

browser.cookies.getAll(
  details,                // object
  function(cookies) {...} // function
)

Parameters

details
object. Information to filter the cookies being retrieved.
urlOptional
string. Restricts the retrieved cookies to those that would match the given URL.
nameOptional
string. Filters the cookies by name.
domainOptional
string. Restricts the retrieved cookies to those whose domains match or are subdomains of this one.
pathOptional
string. Restricts the retrieved cookies to those whose path exactly matches this string.
secureOptional
boolean. Filters the cookies by their Secure property.
sessionOptional
boolean. Filters out session vs. persistent cookies.
storeIdOptional
string. The cookie store to retrieve cookies from. If omitted, the current execution context's cookie store will be used.
callback
function. The function is passed the following arguments:
cookies
array of cookies.Cookie. All the existing, unexpired cookies that match the given cookie info.

Browser compatibility

EdgeFirefoxChromeOpera
Basic support?45.0Yes33
Firefox
Basic support48.0

Examples

Acknowledgements

This API is based on Chromium's chrome.cookies API. This documentation is derived from cookies.json in the Chromium code.

Document Tags and Contributors

 Contributors to this page: wbamberg
 Last updated by: wbamberg,