By Nelu


2015-02-03 17:39:16 8 Comments

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, postman request
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?

9 comments

@Dave Pile 2015-05-02 00:42:03

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"

@151291 2016-10-21 05:45:52

I cleared cookies from chrome and cmd line also, but still postman has session data.

@John Culviner 2017-03-28 16:21:53

this works in the "newish" postman stand-alone app as well. look no further!

@Indrasinh Bihola 2017-05-19 09:25:02

This will only work if you have installed postman interceptor extension and enabled it otherwise you will get cookies options below send button in postman.

@max890 2017-10-23 17:41:02

In 2017, the link is now chrome://settings/content/cookies

@ValRob 2018-03-31 08:39:09

This answer is out of date.

@Andrey 2017-07-23 16:34:48

In the Native Postman app there is "Cookie manager", so that is not a problem at all,

But in the Postman extension for Chrome there is not

So the solution is just in the installing native Postman

Postman for Linux, Mac & Windows

@Andrew Harrison 2017-07-01 01:30:38

Note that this answer applies only to the standalone Postman UI and not the Postman app/add-on for Chrome.

How to clear the cache in Postman (so that you are required to log in again when requesting a token, for example):

  • navigate to View: Show DevTools
  • navigate to the Application tab, then the Clear Storage view in the left menu
  • deselect all choices except Cache Storage, then click on ‘Clear site data’
  • restart Postman
  • you should now be prompted to log in again when requesting a new token

@moplin 2017-06-19 20:35:43

As @markus said use the "Cookie Manager" and delete the cookie. enter image description here

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.

@markus 2016-03-23 20:05:28

Postman 4.0.5 has a feature named Manage Cookies located below the Send button which manages the cookies separately from Chrome it seems.

enter image description here

@Gelin Luo 2016-08-16 23:58:42

can't find that. My postman is 4.4.3

@utkarsh dubey 2017-01-03 13:02:49

There is a cookies button if you move 2 c.m down and 1 c.m right from the bottom right edge of blue send button :)

@nuzzolilo 2017-06-09 18:53:39

@utkarshdubey nope

@EpicDavi 2017-06-29 18:51:41

As far as I know, this is only available in the "native app" rather than the Chrome extension, if anyone was wondering.

@Phillip Thomas 2018-01-02 16:33:20

In the current version of Postman standalone (v5.5.0), this 'Cookies' link is directly under the Send and Save buttons. Screenshots are below by @moplin

@shift66 2018-08-24 05:18:51

This answer should be marked as accepted

@lalithkumar 2017-04-20 10:08:18

You can use the Postman interceptor.That you can add into the chrome extension by this link:https://chrome.google.com/webstore/detail/postman-interceptor/aicmkgpgakddgnaphhhpliifpcfhicfo

This helps you send requests which use browser cookies through the Postman app. It can also send headers which are normally restricted by Chrome but are critical for testing APIs.

And also you can enable by interceptor which is there beside the orange sync icon And also you can enable by interceptor which is there beside the orange sync icon.

@BehrouzMoslem 2016-11-10 14:56:14

into Chrome, right click -> Inspect Element. Go to the tab active tracking of resources and if you have not already. Now the left hand sidebar thingy down until you see "Cookies", click below your domain name and to remove a cookie just right-click on it and "Delete"

@Atieh 2015-04-06 18:39:53

Have you tried Clear Cache extension? Give it a try. It clears app cache, downloads, file systems, form data, history, local storage, passwords and much more, available in the Options settings.

Update: try this answer https://superuser.com/a/232794

I'm not sure of a way to do this in Postman. I used to close the whole browser and reset the server in order to authenticate again. Never tested logout because it was an API service.

@Osiris 2015-02-10 07:05:55

Is the Postman Interceptor enabled? Toggling it will route all requests and responses through the Chrome browser.

Interceptor - https://www.getpostman.com/docs/capture Cookies documentation - http://blog.getpostman.com/index.php/2014/11/28/using-the-interceptor-to-read-and-write-cookies/

@Nelu 2015-02-10 16:34:19

Yes. I tested both with the interceptor on and off and the cookie is still there.

@Guillaume 2016-09-15 16:44:21

Worked for me with Postman 4.7.1 (installed Interceptor, re-run Postman and activated interceptor within Postman)

Related Questions

Sponsored Content

8 Answered Questions

[SOLVED] Sending cookies with postman

  • 2015-06-17 11:34:46
  • MiddleWare
  • 80703 View
  • 45 Score
  • 8 Answer
  • Tags:   cookies postman

1 Answered Questions

Deleting cookies in postman programmatically

  • 2017-07-24 18:05:44
  • Ben
  • 1440 View
  • 7 Score
  • 1 Answer
  • Tags:   cookies postman

1 Answered Questions

0 Answered Questions

Testing cookie-session in postman

2 Answered Questions

[SOLVED] Delete postman cache

  • 2015-12-17 07:07:23
  • Rahul Ahuja
  • 22557 View
  • 27 Score
  • 2 Answer
  • Tags:   postman

3 Answered Questions

[SOLVED] Can not send POST variables to php script on localhost using Postman

  • 2015-08-24 02:31:16
  • Nicolas Miari
  • 14147 View
  • 5 Score
  • 3 Answer
  • Tags:   php http post postman

1 Answered Questions

[SOLVED] Postman not sending session cookie

  • 2017-06-21 01:01:29
  • Tamás Polgár
  • 549 View
  • 0 Score
  • 1 Answer
  • Tags:   postman

3 Answered Questions

[SOLVED] POST request with CSRF works in Postman but fails in cURL

0 Answered Questions

How to I replay a GET request?

2 Answered Questions

[SOLVED] Basic auth in Apigility when using Postman

Sponsored Content