diff --git a/_includes/api/en/4x/res-clearCookie.md b/_includes/api/en/4x/res-clearCookie.md index de90e2471b..5b6ea8517a 100644 --- a/_includes/api/en/4x/res-clearCookie.md +++ b/_includes/api/en/4x/res-clearCookie.md @@ -1,6 +1,14 @@

res.clearCookie(name [, options])

-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). + +
+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. +
Web browsers and other compliant clients will only clear the cookie if the given diff --git a/_includes/api/en/5x/res-clearCookie.md b/_includes/api/en/5x/res-clearCookie.md index de90e2471b..543fe2e2a1 100644 --- a/_includes/api/en/5x/res-clearCookie.md +++ b/_includes/api/en/5x/res-clearCookie.md @@ -1,11 +1,16 @@

res.clearCookie(name [, options])

-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). + +
+The `expires` and `max-age` options are being ignored completely. +
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)
```js