CookieChangeEvent()

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 passed to CookieStore.onchange(). This constructor is called by the browser when a change event occurs.

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

Syntax

var CookieChangeEvent = new CookieChangeEvent(type,eventInitDict);

Parameters

type

A DOMString with the value "changed" or "deleted".

eventInitDictOptional

An object containing:

changed

An array containing a changed cookie.

deleted

An array containing a deleted cookie.

Specifications

Specification
Cookie Store API
# dom-cookiechangeevent-cookiechangeevent

Browser compatibility

BCD tables only load in the browser