Since June 2025, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
A change event is fired at a CookieStore object when a change is made to any cookie.
Use the event name in methods like addEventListener(), or set an event handler property.
addEventListener("change", (event) => { })
onchange = (event) => { }
A CookieChangeEvent. Inherits from Event.
To be informed when a cookie has changed, you can add a handler to the cookieStore instance using addEventListener(), like this:
cookieStore.addEventListener("change", (event) => {
console.log("1 change event");
});
Alternatively, you can use the onchange event handler property to establish a handler for the change event:
cookieStore.onchange = (event) => {
console.log("1 change event");
};
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
change_event |
87 | 87 | 140 | 73 | 18.4 | 87 | 140 | 62 | 18.4 | 14.0 | 87 | 18.4 |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/CookieStore/change_event