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

[Bug] Cookie value depends on login request that fails due to no cookie value #1689

Open
MarkoSulamagi opened this issue Sep 27, 2019 · 6 comments
Labels
N-author-input Needs: response from ticket creator needs-triage

Comments

@MarkoSulamagi
Copy link

Simple issue. I have 2 chained requests

  1. POST /login
  2. GET /whatever

From POST /login I receive a token that is set as cookie value for authentication (using response body attribute).
The problem is that when requesting /login the first time (when no history exists) then IDE gives an error that the request cookie value (authentication token) can't be read (because /login has never been requested).

So I'm unable to request the endpoint that should fill the cookie value.

The error

image


Things tested:

  1. Disabling "Send cookies automatically" for login request doesn't remove the problem
  2. Removing the cookie, making /login request and setting the cookie back will do the job. But obviously it's not a good solution.
  • Insomnia Version: 6.6.2
  • Operating System: Ubuntu 18.04
@welcome
Copy link

welcome bot commented Sep 27, 2019

👋 Thanks for opening your first issue! If you're reporting a 🐞 bug, please make sure
you include steps to reproduce it. If you're requesting a feature 🎁, please provide real
use cases that would benefit. 👪

To help make this a smooth process, please be sure you have first read the
contributing guidelines.

@MarkoSulamagi
Copy link
Author

Any thoughts on ths?

@MarkoSulamagi
Copy link
Author

Still a problem
cc @gschier

@gschier
Copy link
Contributor

gschier commented Dec 11, 2019

I'm not understanding what you are trying to do. Can you provide full requests as an example? Screenshots are fine

@gschier gschier added the N-author-input Needs: response from ticket creator label Dec 11, 2019
@MarkoSulamagi
Copy link
Author

I have a REST API that authenticates requests via Cookie (not custom HTTP Header). There are 2 requests:
POST /sessions - returns a session_id that should be set to cookie
GET /sessions - retrieves the session object based on session_id (session_id is sent to server via cookie).

Problem is that if POST /sessions hasn't been called before then the cookie response value is invalid

Cookie value response
image

Cookie configuration:
If POST /sessions has never been called (history is empty) then it shows that cookie value "Response" is invalid and I'm not able to do POST /sessions, because it says cookie value is invalid (the screenshot in the original post)
image

If I remove the cookie, call POST /sessions and then re-apply the cookie then it shows a valid "Response" as value and both POST and GET /sessions work as expected
image

I hope this helps understand the issue :)

@stale
Copy link

stale bot commented Jun 1, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
N-author-input Needs: response from ticket creator needs-triage
Projects
None yet
Development

No branches or pull requests

3 participants