Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cookie control with collection runs #1228

Closed
nlwillia opened this issue Jul 8, 2015 · 92 comments
Closed

Cookie control with collection runs #1228

nlwillia opened this issue Jul 8, 2015 · 92 comments

Comments

@nlwillia
Copy link

nlwillia commented Jul 8, 2015

I'm testing with a service that sets an unwanted session cookie in the response. If I visit that service in Postman, the cookie is being saved and replayed for later requests.

I've identified several ways to submit a new request without the cookie...

  1. Implement a reset feature in the service that clears the cookie and request it from Postman before making a new service request from the domain/path. (This is not an option if dealing with a 3rd party service.)
  2. Route requests through a proxy that strips the Set-Cookie response header.
  3. Exit Postman and all instances of Chrome including the background process that Chrome runs in the Windows notification area if the "Continue running background apps when Google Chrome is closed" browser setting is checked. Then restart. (Don't think this would work for a non-session cookie.)
  4. Install and enable the Interceptor plugin so that the browser's cookie store is used. Open Chrome to chrome://settings/cookies and manually remove the unwanted cookies before each request. Setting the Cookie header manually from within Postman in Interceptor mode can override the cookie that is sent (Cookie: unwanted-cookie=), but not remove it from the request completely.

None of these are very convenient. Is there a better way to forcibly disable any sort of cookie header being sent?

edit: 2018-04-20 This was originally logged against the Chrome app which has since been deprecated in favor of the native apps. The native apps don't appear to have the same browser-level constraint that made cookie management in Chrome a non-starter. There's now a Cookies link that pops a MANAGE COOKIES modal where cookies can be added or removed. This is an improvement as it's now possible to directly remove an unwanted cookie. Unfortunately there still doesn't seem to be a way to disable cookies entirely. However, the Pre-request Script option is promising as a way to run script to configure things that aren't supported in the UI. This does not appear to support cookie manipulation, but there's a recent issue suggesting it. If that's possible and gets done, then that will become a way to (finally) address this use case.

An aside to all the +1-ers out there, Github has had reactions for over 2 years now; please use them!

@richarddavenport
Copy link

I agree. I would love to be able to see the cookies and clear or edit them.

@b0elter
Copy link

b0elter commented Jul 8, 2015

+1

@abhijitkane
Copy link
Member

This is currently a limitation of the Chrome platform - packaged apps do not have access to Cookies that have been set, nor is there a way to edit/delete them. There are 2 bugs filed on crbug - https://code.google.com/p/chromium/issues/detail?id=236585, https://code.google.com/p/chromium/issues/detail?id=152758

Still waiting for a response on these.

@dbalabka
Copy link

dbalabka commented Oct 5, 2015

+1 . My current solution is:

  1. Open any page on the same domain in GoogleChrome
  2. Open Developer tools(F12)
  3. In Developers tool tab Resources clear all cookies before each request 😄 It's very annoying but works
    image

@a85 a85 added transfer and removed transfer labels Jan 28, 2016
@ghost
Copy link

ghost commented Apr 8, 2016

+1 to have the option to send a request without cookies.

@philals
Copy link

philals commented May 8, 2016

+1

5 similar comments
@tobilarscheid
Copy link

+1

@divayprakash
Copy link

+1

@akirayamamoto
Copy link

+1

@PiWhy
Copy link

PiWhy commented Aug 19, 2016

+1

@lshapsa
Copy link

lshapsa commented Aug 29, 2016

+1

@cychai
Copy link

cychai commented Aug 31, 2016

@matthewkimber
Copy link

+1

@a85 a85 added feature and removed Tentative labels Sep 27, 2016
@kimek
Copy link

kimek commented Sep 28, 2016

+1

3 similar comments
@dteirney
Copy link

+1

@jeremypaskalicimpress
Copy link

+1

@ericcarino
Copy link

+1

@sdnts
Copy link

sdnts commented Nov 3, 2016

Hey guys, cookie management is a limitation of the Chrome platform, but it is possible in the native apps. Could you give them a shot and check if that is easier? You can download our native apps for OSX/Windows/Linux here.

@dteirney
Copy link

dteirney commented Nov 3, 2016

I've been using the native application for some time now. While you can delete cookies manually I can't find any setting or preference to prevent cookies being stored in the first place. This makes it seemingly impossible to use the collection runner and not have the results affected by the cookies that are stored.

@bkubiak
Copy link

bkubiak commented Nov 10, 2016

Hey, could you add possibility to disable cookies in Mac OS native app? I can delete them manually, but this is very inconvenient.

@ayancey
Copy link

ayancey commented Nov 26, 2016

+1

@SidhantDuggal
Copy link

I've been using the native application. I can't find any setting or preference to prevent cookies being stored in the first place. This makes it apparently impossible to use the collection runner without affecting the results ( by the erstwhile cookies ).

@garmoshka-mo
Copy link

garmoshka-mo commented Dec 5, 2016

Actually this extension is useless for rails REST testing, though it could be convenient tool, because many cool useful UI-features implemented.
Hm, why authors of this app are so.. "specific"? Put so much efforts to create application, which can't be used because of small stick in the wheels

@DanielStoica85
Copy link

@madebysid Any update on this?

@sdnts
Copy link

sdnts commented Feb 8, 2017

Work on making cookies manageable from pre-request / test scripts is underway, I'll let you guys know here when we have something :)

@plumpNation
Copy link

+1

@shamasis
Copy link
Member

shamasis commented Mar 24, 2019

@codenirvana based on our last review of cookie related issues, let’s add cookie syncing / persisting controls before and after runs. that would unblock a number of related use cases.

@codenirvana codenirvana self-assigned this Mar 24, 2019
@shamasis
Copy link
Member

We were thinking of ways to address all use cases in this and take this up ASAP. So, here are the thoughts:

We solve it in two parts: (1) Add session control on runner start and stop (2) Add cookie control API within scripts

  1. By session control, I mean you get to choose what you want to carry over from the main window when run starts and for every subsequent run.
    -- For a run, you can choose to start with a fresh session and that would use initial values for environment and blank cookie jar.
    -- You can also choose what to do with cookies when run ends (just like what is available with the "persist variables" feature.)

  2. For other use cases where one needs to clear cookies at special points in run as well as on iteration change, etc... we open up pm.cookies or some variant of it that has access to entire Cookie Jar and can be manipulated programmatically at any point.

@shamasis shamasis changed the title Option to disable cookies? Cookie control with collection runs Mar 28, 2019
@fabOnReact
Copy link

where to find the cookies management in the native app

postman cookies

@Bluscream
Copy link

HOW TO DO THIS?

@fabOnReact
Copy link

@Bluscream better not using all caps, please edit your message
the screen is from the postman ubuntu desktop app. The rest is self-explanatory

@vikiCoder
Copy link

Hello everyone,

We have added the following options in collection runner to provide more control over cookies while running a collection:

  • Run collection without using stored cookies
  • Save cookies after collection run

These options are available in Postman App version 7.1.0 or later. Below is a screenshot showing off these options in runner window.

Screenshot:

Screenshot 2019-06-12 at 3 46 18 PM

@regisbsb
Copy link

@vikiCoder This does not help when you need to clear the cookies as part of a request. It would be very nice just to add cookie manipulation to the script

@vikiCoder
Copy link

@regisbsb We are working on improving cookies UI in the App with more options to manage cookies as well as allowing cookies control from scripts. There is no final release date for those features yet. Stay tuned for the updates.

@theLucasAntunes
Copy link

@vikiCoder As a user who rarely uses the Collection Runner, but test individual requests instead, I find this to be a very niche-focused improvement. I'm not saying it's a bad feature, but we could have this setting for each request.. Maybe a simple checkbox inside the existing "Cookies" window.

@shamasis
Copy link
Member

shamasis commented Jul 2, 2019

@KrilMun @regisbsb ... the programmatic access of cookies are being worked upon as I type. :-) You would be able to white-list a set of domains that would be programmatically manipulated. Will release in Canary soon and I hope to get feedback. :-)

@brettsamann
Copy link

Is there an ETA for that feature? It will be a huge help to some of the workflows I have.

@codenirvana codenirvana added this to the runtime-12 milestone Jul 19, 2019
@codenirvana
Copy link
Member

We've added support for programmatic cookie access in our Canary channel https://www.getpostman.com/canary

Refer #3312 (comment) for detailed documentation.

Everyone, please try it out and share the feedback.
Will update the thread once we release this on our stable channel.

@shamasis
Copy link
Member

@brettsamann @KrilMun @regisbsb - would greatly appreciate any feedback around the programmatic access before we roll it out to production in weeks.

@codenirvana
Copy link
Member

We've added support for programmatic cookie access in the latest version of the Postman app (v7.6.0). Refer #3312 (comment) for more details.

@iamkarlson
Copy link

Whoever switch it on by default for all the users made a huge mistake. This is super annoying and cause a lot of troubles already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests