cookies.getAllCookieStores()

The getAllCookieStores() method of the cookies API returns a list of all cookie stores.

This is an asynchronous function that returns a Promise.

Syntax

var gettingStores = browser.cookies.getAllCookieStores()

Parameters

None.

Return value

A Promise that will be fulfilled with an array of cookies.CookieStore objects representing all the existing cookie stores.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxOperaFirefox for Android
Basic supportChrome Full support YesEdge Full support 14
Notes
Full support 14
Notes
Notes Always returns the same default cookie store with ID 0. All cookies belong to this store.
Firefox Full support 45
Notes
Full support 45
Notes
Notes Before version 52, only the default cookie store was visible. From version 52 onwards, the cookie stores for private browsing mode and container tabs are also readable.
Opera Full support YesFirefox Android Full support 48

Legend

Full support  
Full support
See implementation notes.
See implementation notes.

Examples

In the following snippet, the getAllCookieStores() method is used to retrieve all the cookie stores currently available in the browser, and print out each cookie store ID, and the tabs that currently share each cookie store.

function logStores(cookieStores) {
  for (let store of cookieStores) {
    console.log(`Cookie store: ${store.id}\n Tab IDs: ${store.tabIds}`);
  }
}

var getting = browser.cookies.getAllCookieStores();
getting.then(logStores);

Each member of the cookieStores array is a cookies.CookieStore object.

Acknowledgements

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

Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.

Document Tags and Contributors

Contributors to this page: evilpie, wbamberg, Makyen, chrisdavidmills
Last updated by: evilpie,