vscode-restclient icon indicating copy to clipboard operation
vscode-restclient copied to clipboard

Impossible to override cookie

Open lostfields opened this issue 7 years ago • 9 comments

  • VSCode Version: 1.19.2
  • OS Version: W10Pro
  • REST Client Version: 0.16.2

I have a problem where I'm unable to clear the stored cookies for subsequent requests. The API I'm communicating with doesn't allow the authenticated cookie be sent over another time when authenticating. So, I'm trying to not sending it over by defining Cookie header, but no luck.

Empty cookie key is not allowed by the api either so I can't override it (like "Cookie: key=").

I have to ignore cookies for this request, is that possible?

lostfields avatar Jan 22 '18 07:01 lostfields

@lostfields currently the only possible way is to clear the stored cookie.json file under ~/.rest-client/cookie.json. I'd like to add a new setting to forbid send cookies along with request. Do you think it's OK?

Huachao avatar Jan 22 '18 08:01 Huachao

it would be nice if we could forbid sending cookies per request, or whenever we choose to send cookie manually. What about to include the cookie header if the cookie header isn't present in the request?

lostfields avatar Jan 22 '18 10:01 lostfields

Do you mean only use saved cookies only when cookie header is not present in user's request

Huachao avatar Jan 22 '18 11:01 Huachao

yes or the possibility to turn off cookie for a certain request by using local variables/settings just for that request-block.

lostfields avatar Jan 22 '18 12:01 lostfields

+1 would love to be able to leave out the Cookie header for select requests. I tried doing something like this:

POST https://myapi.com/x
Cookie: 

{
    "foo": "bar"
}

hoping it would just not send a Cookie header at all, but instead it sent the saved cookie (as intended, I'm assuming).

james-klein-sfcc avatar Aug 15 '19 22:08 james-klein-sfcc

Has this feature(clear the cookie in the subsequent requests) been implemented?

chixu avatar Dec 30 '20 09:12 chixu

Cool saw it the setting..

chixu avatar Dec 30 '20 09:12 chixu

Came across this while facing the problem of cookie header not being sent. It has been quite difficult to troubleshoot, since I have been trying to send a cookie header manually and the server kept rejecting it and no idea why. Finally this issue here has the location of the file and I had to manually delete it. And still there is no way to send a cookie header manually.

### Get All Roles
GET http://{{casdoorHost}}/api/get-all-roles
Cookie: casdoor_session_id={{casdoor_session_id}}

Hope to see this fixed. Explicitly sent headers such as above should always take precedence over the saved cookies.

KrishnaPG avatar Aug 05 '22 07:08 KrishnaPG