Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion _includes/api/en/4x/res-clearCookie.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<h3 id='res.clearCookie'>res.clearCookie(name [, options])</h3>

Clears the cookie specified by `name`. For details about the `options` object, see [res.cookie()](#res.cookie).
Clears the cookie with the specified `name` by sending a `Set-Cookie` header that sets its expiration date in the past.
This instructs the client that the cookie has expired and is no longer valid. For more information
about available `options`, see [res.cookie()](#res.cookie).

<div class="doc-box doc-warn" markdown="1">
If the `maxAge` or `expires` options are set, the cookie may not be cleared depending on the time values provided,
as Express does not ignore these options. It is therefore recommended to omit these options when calling this
method. Passing these two options has been deprecated since Express v4.20.0.
</div>

<div class="doc-box doc-notice" markdown="1">
Web browsers and other compliant clients will only clear the cookie if the given
Expand Down
11 changes: 8 additions & 3 deletions _includes/api/en/5x/res-clearCookie.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
<h3 id='res.clearCookie'>res.clearCookie(name [, options])</h3>

Clears the cookie specified by `name`. For details about the `options` object, see [res.cookie()](#res.cookie).
Clears the cookie with the specified `name` by sending a `Set-Cookie` header that sets its expiration date in the past.
This instructs the client that the cookie has expired and is no longer valid. For more information
about available `options`, see [res.cookie()](#res.cookie).

<div class="doc-box doc-notice" markdown="1">
The `expires` and `max-age` options are being ignored completely.
</div>

<div class="doc-box doc-notice" markdown="1">
Web browsers and other compliant clients will only clear the cookie if the given
`options` is identical to those given to [res.cookie()](#res.cookie), excluding
`expires` and `maxAge`.
`options` is identical to those given to [res.cookie()](#res.cookie)
</div>

```js
Expand Down