nodejsHow to delete client cookies.
I made two interfaces.
A cookie will be set on the page after accessing interface a.
The cookie will be deleted after the b interface is accessed.
But my b interface cannot be deleted
res.setHeader("Set-Cookie", ["id="]);
I can clear it using this method, but the client will still leave fields like id=. Is there any way to delete it directly?
You can only make it invalid immediately by setting the expiration time
res.cookie(prop, '', {expires: new Date(0)});