Reputation: 6248
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?
Upvotes: 1
Views: 2084
Reputation: 3895
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]
Upvotes: 2