Hello guys I have this cookie I want to know how I can delete it I'm tired of trying and it didn't work, I tried it with res.clearCookie ()
res.cookie('teste', username, {maxAge: 10000 });
Somebody help me? Please
Welcome Jessica, if I am not wrong , I don't think there is a way to delete cookies in nodejs except by setting up the expiration date. This below code should do the job, because you are setting the expiration date to now
cookies.set('teste', {expires: Date.now()});
I managed to solve with:
res.clearCookie()
actually the problem is that I was creating the cookie again on the client side