Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

cookies.CookieStore

この記事はまだボランティアによって 日本語 に翻訳されていません。ぜひ MDN に参加して翻訳を手伝ってください!

The CookieStore type of the cookies API represents a cookie store in the browser.

Windows in different browsing modes may use different cookie stores — a private browsing/incognito mode window, for instance, will use a separate cookie store from a non-incognito/private window.

Type

Values of this type are objects, which can contain the following properties:

id
A string representing the unique identifier for the cookie store.
tabIds
An array of integers, which identifies all of the browser tabs that share this cookie store.

Browser compatibility

Chrome Edge Firefox Firefox for Android Opera
Basic support Yes Yes 45.0 48.0 33

Examples

In the following snippet, the cookies.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.

chrome.cookies.getAllCookieStores(function(cookieStores) {
  for(var i = 0; i < cookieStores.length; i++) {
    console.log('Cookie store: ' + cookieStores[i].id +
                '\n Tab IDs: ' + cookieStores[i].tabIds);
  }
});

Each member of the cookieStores array is a 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.

ドキュメントのタグと貢献者

 このページの貢献者: Makyen, wbamberg, chrisdavidmills
 最終更新者: Makyen,