clearcookie doesn't remove httpOnly cookie nodejs

Viewed 15

My question may be simple but I can't find how to do it and I tried for hours to find a way but I can't. I have a nodejs back that sets an httpOnly cookie like this

res.cookie('jwt', token, { httpOnly: true, maxAge: 3 * 60 * 60 * 1000 });

and I tried both

res.clearCookie('jwt', { httpOnly: true, domain: 'localhost', path: '/' });

and

res.cookie('jwt', '', {maxAge:0}); // or just res.cookie('jwt', '') or with httpOnly:true

I can't figure out how to remove this cookie please someone help, thanks to anyone who can help.

0 Answers
Related