Kong / Kong/insomnia

Cookies not overwriting

Open
#8,791 5 comments 3 reactions 0 assignees View on GitHub
B-bug S-unverified
Dominant language
TypeScript
Stars
40k
Forks
2.4k
Avg merge
2d 13h
Merged PRs (30d)
61

Description

### Expected Behavior

When a Set-Cookie header is sent by server, after a cookie with the same name exists in the client, Insomnia creates a second cookie rather than overwriting the existing cookie.

### Actual Behavior

When using insomnia to test api's that deal with login, i've seen a problem when the user sets the auth cookie more than once - Insomnia does not handle cookies properly. The expected behavior is for insomnia to overwrite the cookie, instead it adds it to the cookie store as an additional cookie.

### Reproduction Steps

1. Create a server which sets a different cookie on each request.
2. Send request 1: cookie A1 will be returned.
3. Send request 2: (cookie A1 will be sent) - cookie A2 will be returned.
4. Send request 3: cookie A1 will still be sent

### Is there an existing issue for this?

- [x] I have searched the [issue tracker](https://www.github.com/Kong/insomnia/issues) for this problem.

### Which sync method do you use?

- [ ] Git sync.
- [x] Insomnia Cloud sync.
- [ ] Local only

### Additional Information

_No response_

### Insomnia Version

11.2.0

### What operating system are you using?

macOS

### Operating System Version

macos sequoia 15.3.1

### Installation method

insomnia website

### Last Known Working Insomnia version

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the cookie sequence described in the issue: send three requests where each response sets a different value for the same cookie, then inspect the cookie store and subsequent request headers. Trace the Set-Cookie handling and determine where duplicate same-name cookies are retained. Done means the latest cookie replaces the previous one and request 3 sends the replacement value.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.