如何在邮递员中删除会话cookie? [英] How to delete session cookie in Postman?
问题描述
我正在Postman中测试我的API,无法模拟登出。
I am testing my API in Postman and am having trouble simulating a log out.
如果我打电话删除会话cookie,
会话cookie仍在 之后,我仍然可以访问需要身份验证的路由。
If I do a call to delete the session cookie,
the session cookie is still there afterwards, and I'm still able to access routes that require authentication.
服务器上的路由处理程序为:
The route handler on the server is:
server.route({
method: 'DELETE',
path: '/sessions/_current',
handler: function(req, reply){
req.auth.session.clear();
reply({}).code(204);
}
});
这是带有Hapi的Node.js,但这没关系。
是否可以通过删除邮递员中的所有cookie 或手动某些cookie ?
推荐答案
在chrome浏览器中手动删除它会从Postman中删除cookie。
Manually deleting it in the chrome browser removes the cookie from Postman.
在您的chrome浏览器转到 chrome:// settings / cookies
In your chrome browser go to chrome://settings/cookies
查找并删除Cookie
Find the cookie and delete it
编辑:
根据下面的Max890注释(在我的Google Chrome浏览器(版本63)中),现在是
chrome:// settings / content / cookies
然后转到查看所有cookie和站点数据
As per Max890 comment below (in my version of Google Chrome (ver 63)) this is now
chrome://settings/content/cookies
Then go to "See all cookies and site data"
针对Google Chrome 79.0.3945.88的更新
chrome:// settings / siteData?search = cookies
chrome://settings/siteData?search=cookies
这篇关于如何在邮递员中删除会话cookie?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!