[GH-ISSUE #443] cookie not found support #167

Closed
opened 2026-03-16 13:50:04 +03:00 by kerem · 18 comments
Owner

Originally created by @BruceWayneVsSuperMan on GitHub (Dec 19, 2019).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/443

Our server responsed cookie not found error.
But actually,with the same param postman worked.
I wonder know if I need to add some extra param when I use postwoman.

Originally created by @BruceWayneVsSuperMan on GitHub (Dec 19, 2019). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/443 Our server responsed cookie not found error. But actually,with the same param postman worked. I wonder know if I need to add some extra param when I use postwoman.
Author
Owner

@liyasthomas commented on GitHub (Dec 19, 2019):

Under normal conditions, params are sent as (async/await XHR) HTTP requests. If there's any specific criteria for your server, you've to append that information either in params or headers as server request.

Share endpoint to debug

<!-- gh-comment-id:567371709 --> @liyasthomas commented on GitHub (Dec 19, 2019): Under normal conditions, params are sent as (async/await XHR) HTTP requests. If there's any specific criteria for your server, you've to append that information either in params or headers as server request. > Share endpoint to debug
Author
Owner

@BruceWayneVsSuperMan commented on GitHub (Dec 19, 2019):

Thanks for your reply.
I understand your meaning. But the thing I do want to know is how to make it work like postman.
Means that I don't need to add cookie or login info.
I want to use postwoman replace postman.Because I think it looks beautiful and I can use it in explore.

<!-- gh-comment-id:567376888 --> @BruceWayneVsSuperMan commented on GitHub (Dec 19, 2019): Thanks for your reply. I understand your meaning. But the thing I do want to know is how to make it work like postman. Means that I don't need to add cookie or login info. I want to use postwoman replace postman.Because I think it looks beautiful and I can use it in explore.
Author
Owner

@liyasthomas commented on GitHub (Dec 19, 2019):

Let me look into the issue and get back to you after a while. I think there's an option to use cookies with withCredentials: true

<!-- gh-comment-id:567378791 --> @liyasthomas commented on GitHub (Dec 19, 2019): Let me look into the issue and get back to you after a while. I think there's an option to use cookies with `withCredentials: true`
Author
Owner

@BruceWayneVsSuperMan commented on GitHub (Dec 19, 2019):

All right, waiting for your good news.

<!-- gh-comment-id:567394066 --> @BruceWayneVsSuperMan commented on GitHub (Dec 19, 2019): All right, waiting for your good news.
Author
Owner

@liyasthomas commented on GitHub (Dec 22, 2019):

Nuxt Axios module currently support credentials option only work when axios request to baseURL or relative path.

This is in the specification, not a bug.

https://github.com/nuxt-community/axios-module/issues/168#issuecomment-471670927

<!-- gh-comment-id:568224392 --> @liyasthomas commented on GitHub (Dec 22, 2019): Nuxt Axios module currently support credentials option only work when axios request to `baseURL` or relative path. This is in the specification, not a bug. https://github.com/nuxt-community/axios-module/issues/168#issuecomment-471670927
Author
Owner

@NBTX commented on GitHub (Dec 22, 2019):

I'm reading that we can just set withCredentials: true to the .$post options...

<!-- gh-comment-id:568278964 --> @NBTX commented on GitHub (Dec 22, 2019): I'm reading that we can just set `withCredentials: true` to the `.$post` options...
Author
Owner

@liyasthomas commented on GitHub (Dec 22, 2019):

But isn't that only supposed to be working on requests sent to same origin?

<!-- gh-comment-id:568279063 --> @liyasthomas commented on GitHub (Dec 22, 2019): But isn't that only supposed to be working on requests sent to same origin?
Author
Owner

@BruceWayneVsSuperMan commented on GitHub (Dec 23, 2019):

I just found something that may help us.
Please see this pic.
I am wondering if the secret is the postman-token param.

<!-- gh-comment-id:568321958 --> @BruceWayneVsSuperMan commented on GitHub (Dec 23, 2019): I just found something that may help us. Please see this pic. I am wondering if the secret is the postman-token param.
Author
Owner

@BruceWayneVsSuperMan commented on GitHub (Dec 23, 2019):

If you can't see this pic, leave me a message.Cause I was limited on internet,and I can't see if it's uploaded.

<!-- gh-comment-id:568322562 --> @BruceWayneVsSuperMan commented on GitHub (Dec 23, 2019): If you can't see this pic, leave me a message.Cause I was limited on internet,and I can't see if it's uploaded.
Author
Owner

@liyasthomas commented on GitHub (Dec 23, 2019):

Can't see the image.

<!-- gh-comment-id:568323597 --> @liyasthomas commented on GitHub (Dec 23, 2019): Can't see the image.
Author
Owner

@BruceWayneVsSuperMan commented on GitHub (Dec 23, 2019):

Very appreciate for your patience and help.
I sent it to your email.Please check it out.

<!-- gh-comment-id:568324918 --> @BruceWayneVsSuperMan commented on GitHub (Dec 23, 2019): Very appreciate for your patience and help. I sent it to your email.Please check it out.
Author
Owner

@liyasthomas commented on GitHub (Dec 23, 2019):

Got the mail. It seems like, a cookie is sent as a custom header along with the request.

In PW, you can add custom Headers too. In Options section, navigate to Headers tab to add custom headers.

1223_1

But I wonder how you generated this custom header postman-token's value? I suppose you took Cookie from Environment variables.

Here's a screenshot of how I added a custom header and generated cURL code snippet with PW.

Screenshot_20191223-072254

If you've limited internet access, no need to download the image, this is the generated cURL:

curl -X GET \
  'https://reqres.in/api/users' \
  -H 'cache-control: no-cache' \
  -H 'postwoman-token: this_can_whatever_you_want' \
  -H 'content-type: application/json'

And here's your public Sharable link with above configuration: https://postwoman.io/?method=GET&url=https%3A%2F%2Freqres.in&path=%2Fapi%2Fusers&headers=%5B%7B%22key%22%3A%22cache-control%22,%22value%22%3A%22no-cache%22%7D,%7B%22key%22%3A%22postwoman-token%22,%22value%22%3A%22this_can_whatever_you_want%22%7D,%7B%22key%22%3A%22content-type%22,%22value%22%3A%22application%2Fjson%22%7D%5D&rawParams=%7B%7D

Open this link to preload configs

<!-- gh-comment-id:568327277 --> @liyasthomas commented on GitHub (Dec 23, 2019): Got the mail. It seems like, a cookie is sent as a custom header along with the request. In PW, you can add custom Headers too. In **Options** section, navigate to **Headers** tab to add custom headers. ![1223_1](https://user-images.githubusercontent.com/10395817/71330525-8c9f8800-2553-11ea-88ad-1d785edd71c1.jpg) But I wonder how you generated this custom header `postman-token`'s value? I suppose you took Cookie from Environment variables. Here's a screenshot of how I added a custom header and generated cURL code snippet with PW. ![Screenshot_20191223-072254](https://user-images.githubusercontent.com/10395817/71330813-14d25d00-2555-11ea-9cf5-0bebf9f87dfb.png) If you've limited internet access, no need to download the image, this is the generated cURL: ``` curl -X GET \ 'https://reqres.in/api/users' \ -H 'cache-control: no-cache' \ -H 'postwoman-token: this_can_whatever_you_want' \ -H 'content-type: application/json' ``` And here's your public Sharable link with above configuration: https://postwoman.io/?method=GET&url=https%3A%2F%2Freqres.in&path=%2Fapi%2Fusers&headers=%5B%7B%22key%22%3A%22cache-control%22,%22value%22%3A%22no-cache%22%7D,%7B%22key%22%3A%22postwoman-token%22,%22value%22%3A%22this_can_whatever_you_want%22%7D,%7B%22key%22%3A%22content-type%22,%22value%22%3A%22application%2Fjson%22%7D%5D&rawParams=%7B%7D _Open this link to preload configs_
Author
Owner

@BruceWayneVsSuperMan commented on GitHub (Dec 23, 2019):

Emmm…… actually,I didn't add the postman-token. Everytime when I try to request, postman will generate a new postman-token.
I read an article about it, this is the answer.

This is primarily used to bypass a bug in Chrome. If an XMLHttpRequest is pending and another request is sent with the same parameters then Chrome returns the same response for both of them. Sending a random token avoids this issue. This can also help you distinguish between request on the server side.

<!-- gh-comment-id:568332378 --> @BruceWayneVsSuperMan commented on GitHub (Dec 23, 2019): Emmm…… actually,I didn't add the postman-token. Everytime when I try to request, postman will generate a new postman-token. I read an article about it, this is the answer. This is primarily used to bypass a bug in Chrome. If an XMLHttpRequest is pending and another request is sent with the same parameters then Chrome returns the same response for both of them. Sending a random token avoids this issue. This can also help you distinguish between request on the server side.
Author
Owner

@liyasthomas commented on GitHub (Dec 23, 2019):

Thanks! Will look into it

Sooner or later, we're gonna have to implement this 😊

<!-- gh-comment-id:568332568 --> @liyasthomas commented on GitHub (Dec 23, 2019): Thanks! Will look into it Sooner or later, we're gonna have to implement this 😊
Author
Owner

@BruceWayneVsSuperMan commented on GitHub (Dec 23, 2019):

I think so.It will be better with your development.
Actually I received a lot of email last weekend cause I followed and watched this project, you were solving problems anytime,anywhere...

<!-- gh-comment-id:568336263 --> @BruceWayneVsSuperMan commented on GitHub (Dec 23, 2019): I think so.It will be better with your development. Actually I received a lot of email last weekend cause I followed and watched this project, you were solving problems anytime,anywhere...
Author
Owner

@liyasthomas commented on GitHub (Dec 23, 2019):

Just shipped API documentation feature 😄

<!-- gh-comment-id:568336649 --> @liyasthomas commented on GitHub (Dec 23, 2019): Just shipped API documentation feature :smile:
Author
Owner

@jackflyer commented on GitHub (Mar 24, 2020):

Is there any option to set withCredentials from front side? or guide on where to set that option.

<!-- gh-comment-id:603348851 --> @jackflyer commented on GitHub (Mar 24, 2020): Is there any option to set withCredentials from front side? or guide on where to set that option.
Author
Owner

@liyasthomas commented on GitHub (Mar 24, 2020):

@jackflyer https://github.com/nuxt-community/axios-module/issues/168#issuecomment-471670927

<!-- gh-comment-id:603411109 --> @liyasthomas commented on GitHub (Mar 24, 2020): @jackflyer https://github.com/nuxt-community/axios-module/issues/168#issuecomment-471670927
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#167
No description provided.