Skip to content

Commit

Permalink
Fix CookieChangeEvent description
Browse files Browse the repository at this point in the history
  • Loading branch information
wbamberg committed Jul 27, 2024
1 parent 6336af7 commit 7c2562b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 2 additions & 0 deletions files/en-us/web/api/cookiechangeevent/changed/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ browser-compat: api.CookieChangeEvent.changed

The **`changed`** read-only property of the {{domxref("CookieChangeEvent")}} interface returns an array of the cookies that have been changed.

Note that this will exclude cookies which were created with an expiry date in the past, as these cookies are immediately deleted.

## Value

An array of objects containing the changed cookie(s). Each object contains the following properties:
Expand Down
2 changes: 2 additions & 0 deletions files/en-us/web/api/cookiechangeevent/deleted/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ browser-compat: api.CookieChangeEvent.deleted

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.

## Value

An array of objects containing the deleted cookie(s). Each object contains the following properties:
Expand Down
12 changes: 3 additions & 9 deletions files/en-us/web/api/cookiechangeevent/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@ browser-compat: api.CookieChangeEvent

{{securecontext_header}}{{APIRef("Cookie Store API")}}

The **`CookieChangeEvent`** interface of the {{domxref("Cookie Store API", "", "", "nocode")}} is the event type of the {{domxref("CookieStore/change_event", "change")}} event fired at a {{domxref("CookieStore")}} when any cookie changes occur. A cookie change consists of a cookie and a type (either "changed" or "deleted").

Cookie changes that will cause the `CookieChangeEvent` to be dispatched are:

- A cookie is newly created and not immediately removed. In this case `type` is "changed".
- A cookie is newly created and immediately removed. In this case `type` is "deleted".
- A cookie is removed. In this case `type` is "deleted".
The **`CookieChangeEvent`** interface of the {{domxref("Cookie Store API", "", "", "nocode")}} is the event type of the {{domxref("CookieStore/change_event", "change")}} event fired at a {{domxref("CookieStore")}} when any cookies are created or deleted.

> [!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.
Expand All @@ -30,9 +24,9 @@ Cookie changes that will cause the `CookieChangeEvent` to be dispatched are:
_This interface also inherits properties from {{domxref("Event")}}._

- {{domxref("CookieChangeEvent.changed")}} {{ReadOnlyInline}}
- : Returns an array containing one or more changed cookies.
- : An array listing all newly-created cookies. Note that this will exclude cookies which were created with an expiry date in the past, as these cookies are immediately deleted.
- {{domxref("CookieChangeEvent.deleted")}} {{ReadOnlyInline}}
- : Returns an array containing one or more deleted cookies.
- : An array listing all cookies which were removed, either because they expired or because they were explicitly deleted. Note that this will include cookies which were created with an expiry date in the past.

## Instance methods

Expand Down

0 comments on commit 7c2562b

Please sign in to comment.