CookieChangeEvent: CookieChangeEvent() constructor

Baseline 2025
Newly available

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.

The CookieChangeEvent() constructor creates a new CookieChangeEvent object which is the event type of the change event fired at a CookieStore when any cookie changes occur. This constructor is called by the browser when a change event occurs.

Note: This event constructor is generally not needed for production websites. It's primary use is for tests that require an instance of this event.

Syntax

js
new CookieChangeEvent(type)
new CookieChangeEvent(type, options)

Parameters

type

A string with the name of the event. It is case-sensitive and browsers always set it to change.

options Optional

An object that, in addition of the properties defined in Event(), can have the following properties:

changed Optional

An array containing the changed cookies.

deleted Optional

An array containing the deleted cookies.

Return value

A new CookieChangeEvent object.

Specifications

Specification
Cookie Store API
# dom-cookiechangeevent-cookiechangeevent

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
CookieChangeEvent() constructor
Chrome – Full support
Chrome 87 (Release date: 2020-11-17)
footnote Full support
Edge – Full support
Edge 87 (Release date: 2020-11-19)
footnote Full support
Firefox – Full support
Firefox 140 (Release date: 2025-06-24)
footnote Full support
Opera – Full support
Opera 73 (Release date: 2020-12-09)
footnote Full support
Safari – Full support
Safari 18.4 (Release date: 2025-03-31)
footnote Full support
Chrome Android – Full support
Chrome Android 87 (Release date: 2020-11-17)
footnote Full support
Firefox for Android – Full support
Firefox for Android 140 (Release date: 2025-06-24)
footnote Full support
Opera Android – Full support
Opera Android 62 (Release date: 2021-02-16)
footnote Full support
Safari on iOS – Full support
Safari on iOS 18.4 (Release date: 2025-03-31)
footnote Full support
Samsung Internet – Full support
Samsung Internet 14 (Release date: 2021-04-17)
footnote Full support
WebView Android – Full support
WebView Android 87 (Release date: 2020-11-17)
footnote Full support
WebView on iOS – Full support
WebView on iOS 18.4 (Release date: 2025-03-31)
footnote Full support

Legend

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

Full support
Full support