cookies.getAllCookieStores()

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

To use this method, an extension must have the "cookies" permission. See cookie permissions for more details.

This is an asynchronous function that returns a Promise.

Syntax

js
let gettingStores = browser.cookies.getAllCookieStores()

Parameters

None.

Return value

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

Examples

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

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

browser.cookies.getAllCookieStores().then(logStores);

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

Browser compatibility

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
getAllCookieStores

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
See implementation notes.
Has more compatibility info.

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