分类: Windows平台
2020-10-16 13:46:28
I'm looking for a way to clear cookies between each test, I know I am able to do this via the GUI but I want to do it automatically in the pre-request scripts. I tried document.setCookie = ..., but document isn't defined.
My current work around is to set the cookies into global variables, and use these variables in the header values, which allows me to set the values to empty strings at the beginning of each test.
|
Hi , sorry about the delay here. This isn't possible right now, but we've been actively looking into this. I'm tagging this as a feature request, and will let you know here when it is out :)
|
Hi, I'm trying to find a workaround in order to neutralize a cookie returned by the server.
Is there a way to get the cookie object ?
currently, if I use pm.cookies, I get an array that contains the cookie, I can even erase it with pm.cookies.clear() but it doesn't erase the cookie (though pm.cookies array is empty).
I wonder how to get the object (pm.cookies[0] does not work) so I could modify its expiry date, for instance.
thank you
Alexandre
|
I found a way to get the cookie object, however the "expires" property is not available :(
I used pm.cookies.idx(0)
is it possible to make it available and writeable ?
well, anyway it is useless, as modifying a propertie through pm.cookies methods is not reflected in postman (ie. I changed the cookie name, I can see it changed when I log pm.cookies but when I open the "Manage Cookies" window in postman, there is no change reflected ...
|
the pm.cookies now allows you read and set cookies. We will be extending it to add more functionality to cookies.
|
Ok, but does it concerns every cookie (send and received ?) because when I use it to modify a received cookie, I can see the change in pm.cookies but when I enter the cookie management window (on the right hand side of postman windows app) I don't see any update in the concerned cookie ?
|
Hi, is there any update on this issue, or others like this (, I'm looking at you)? As it happens, we had no other option but to turn away from using Postman for anything automated in our company, this is a make-or-break feature for us.
|