files/en-us/web/api/cookiechangeevent/deleted/index.md
{{securecontext_header}}{{APIRef("Cookie Store API")}}
The deleted read-only property of the {{domxref("CookieChangeEvent")}} interface returns an array of the cookies that have been deleted by the given CookieChangeEvent instance.
Note that this will include cookies which were created with an expiry date in the past, as these cookies are immediately deleted.
An array of objects containing the deleted cookie(s). Each object contains the following properties:
name
value
domain
path
expires
secure
sameSite
SameSite values:
"strict"
"lax"
"none"
partitioned
true) or not (false). See Cookies Having Independent Partitioned State (CHIPS) for more information.In this example, when the cookie is deleted, the event listener logs the first item in the CookieChangeEvent.deleted property to the console. It contains an object representing the cookie that has just been deleted.
cookieStore.addEventListener("change", (event) => {
console.log(event.deleted[0]);
});
{{Specifications}}
{{Compat}}