This answer shows how to clear a single cookie in NodeJS. Is there a function to clear all cookies without iterating through all of them and clearing them (or expiring them) individually?
Asked
Active
Viewed 2,000 times
1 Answers
2
No, there isn't. According to RFC for Cookies, a server shouldn't sent multiple responses to clear cookie even.
If a server sends multiple responses containing Set-Cookie headers concurrently to the user agent (e.g., when communicating with the user agent over multiple sockets), these responses create a "race condition" that can lead to unpredictable behavior.
ALso, you should only be able to send one value for Set-Cookie
, even in order to unset a cookie.
Read More: https://www.rfc-editor.org/rfc/rfc6265 [Pg 9]

Community
- 1
- 1

Vikram Tiwari
- 3,615
- 1
- 29
- 39