Class CookieChangeEvent
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
The CookieChangeEvent interface of the {{domxref("Cookie Store API", "", "", "nocode")}} is the event type of the CookieStorechange event fired at a CookieStore when any cookies are created or deleted.
[Value("CookieChangeEvent")]
public class CookieChangeEvent : Event
- Inheritance
-
CookieChangeEvent
- Inherited Members
Remarks
NOTE
A cookie that is replaced due to the insertion of another cookie with the same name, domain, and path, is ignored and does not trigger a change event.
Constructors
CookieChangeEvent()
public CookieChangeEvent()
CookieChangeEvent(string, CookieChangeEventInit)
The CookieChangeEvent() constructor creates a new CookieChangeEvent object
which is the event type of the CookieStorechange event fired at a CookieStore when any cookie changes occur.
This constructor is called by the browser when a change event occurs.
public CookieChangeEvent(string type, CookieChangeEventInit eventInitDict = null)
Parameters
typestringeventInitDictCookieChangeEventInit
Remarks
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.
Properties
Changed
The changed read-only property of the CookieChangeEvent interface returns an array of the cookies that have been changed.
[Value("changed")]
public CookieListItem[] Changed { get; }
Property Value
- CookieListItem[]
An array of objects containing the changed cookie(s). Each object contains the following properties:
Remarks
Note that this will exclude cookies which were created with an expiry date in the past, as these cookies are immediately deleted.
Deleted
The deleted read-only property of the CookieChangeEvent interface returns an array of the cookies that have been deleted by the given CookieChangeEvent instance.
[Value("deleted")]
public CookieListItem[] Deleted { get; }
Property Value
- CookieListItem[]
An array of objects containing the deleted cookie(s). Each object contains the following properties:
Remarks
Note that this will include cookies which were created with an expiry date in the past, as these cookies are immediately deleted.