insomnia icon indicating copy to clipboard operation
insomnia copied to clipboard

Old cookie sent in requests if any code is placed in the afterResponse script

Open specialobyno opened this issue 2 years ago • 2 comments

Expected Behavior

If I have a code in the afterResponse script (say to set an environment variable), after the request, any cookies saved by insomnia should be present in further requests.

Actual Behavior

Once there is a code in the afterResponse script (even if it is commented out), cookie session breaks. New cookies gotten in response does not override the old cookies saved, even though insomnia tries to save the new cookies.

Reproduction Steps

  1. Build an endpoint that returns a cookie (random string) in the header.
  2. Make a request to the end point and observe the cookie returned.
  3. Make a request to the same endpoint again and observe that the cookie previously returned was sent in the request header.
  4. Write anything in the afterResponse script (you can comment it out if you want).
  5. Make a request to the same endpoint and observe the new cookie returned
  6. Make another request to the same endpoint and observe that the cookie sent in the request header is the old one (not the latest one returned)

Is there an existing issue for this?

Additional Information

You can do a simple express project that returns a cookie

Insomnia Version

9.3.3

What operating system are you using?

macOS

Operating System Version

Sonoma 14.5

Installation method

Download from Insomnia website

Last Known Working Insomnia version

No response

specialobyno avatar Sep 12 '24 14:09 specialobyno

duplicate of #7808, it should have been fixed in the latest v10.0.

notjaywu avatar Sep 13 '24 07:09 notjaywu

Hello @specialobyno please try the latest version (10.0.0) and thanks for your detailed feedback.

ihexxa avatar Sep 13 '24 08:09 ihexxa