Skip to content

Commit 96e48ac

Browse files
committed
Document cookie changed event
1 parent d83534d commit 96e48ac

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

docs/api/session.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,27 @@ session.defaultSession.cookies.set(cookie, (error) => {
395395
})
396396
```
397397

398+
### Instance Events
399+
400+
The following events are available on instances of `Cookies`:
401+
402+
#### Event: 'changed'
403+
404+
* `event` Event
405+
* `cookie` Object - The cookie that was changed
406+
* `cause` String - The cause of the change with one of the following values:
407+
* `explicit` - The cookie was changed directly by a consumer's action.
408+
* `overwrite` - The cookie was automatically removed due to an insert
409+
operation that overwrote it.
410+
* `expired` - The cookie was automatically removed as it expired.
411+
* `evicted` - The cookie was automatically evicted during garbage collection.
412+
* `expired-overwrite` - The cookie was overwritten with an already-expired
413+
expiration date.
414+
* `removed` Boolean - `true` if the cookie was removed, `false` otherwise.
415+
416+
Emitted when a cookie is changed because it was added, edited, removed, or
417+
expired.
418+
398419
### Instance Methods
399420

400421
The following methods are available on instances of `Cookies`:

0 commit comments

Comments
 (0)