Destroy http-only cookie with cookie-parser

自闭症网瘾萝莉.ら 提交于 2019-12-24 22:12:20

问题


I am using cookie-parser to create a http-only cookie that holds the token for a logged-in user.

Then I need to either destroy that cookie or make it expire, when the user hits "logout".

How can I destroy (or at least edit) the cookie?

Will the following do the trick ?

res.cookie("SESSIONID", null, {httpOnly:true, secure:true});

Thank you

来源:https://stackoverflow.com/questions/51116246/destroy-http-only-cookie-with-cookie-parser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!