3

When using an HTTP host I am able to clear out the existing cookies for said host using the CookieJar method of .clear(‘host’). After moving to an HTTPS host, the .clear() method no longer works and the cookie persists. This method is in my Pre-request Script in both instances.

App information (please complete the following information):

App Type Native App Postman Version 7.6.0 OS: Windows 10

Steps to reproduce the behavior:

Call HTTP web service that returns a cookie (secure = false). The cookie will be returned. Re-run the web service. The cookie will be returned with a new value. Call HTTPs web service that returns a cookie (secure = true). The cookie will be returned. Re-run the web service. The existing cookie with the old value will be returned.

const cookieJar = pm.cookies.jar();
cookieJar.clear(pm.variables.get("Cookie Host"), printErr());

function printErr(error){
    console.log(error);
}

Expected behavior I am expecting a new cookie value to be returned in both instances (HTTP and HTTPS)

Yamatoberu
  • 31
  • 1

0 Answers0