How to delete session cookie in Postman?
I am testing my API in Postman and am having trouble simulating a log out.
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);
}
});
This is Node.js with Hapi but it shouldn't matter.
Is there a way to delete all the cookies in Postman or certain cookies manually?
Postman 4.0.5 has a feature named Manage Cookies located below the Send button which manages the cookies separately from Chrome it seems.
Manually deleting it in the chrome browser removes the cookie from Postman.
In your chrome browser go to chrome://settings/cookies
Find the cookie and delete it
Edit:
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"
Update for Google Chrome 79.0.3945.88
chrome://settings/siteData?search=cookies
As @markus said use the "Cookie Manager" and delete the cookie.
If you want to learn how to set destroy cookies in postman, You should check the Postman Echo service https://docs.postman-echo.com/
There you will find complete explanation on how to Set, Get and Delete those cookies.
Check it on : https://docs.postman-echo.com/#3de3b135-b3cc-3a68-ba27-b6d373e03c8c
Give it a Try.