Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yeliex/stackblitz-starters-kfmrzz
Created with StackBlitz ⚡️
https://github.com/yeliex/stackblitz-starters-kfmrzz
Last synced: about 2 months ago
JSON representation
Created with StackBlitz ⚡️
- Host: GitHub
- URL: https://github.com/yeliex/stackblitz-starters-kfmrzz
- Owner: yeliex
- Created: 2024-04-18T02:19:19.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-04-18T02:31:54.000Z (9 months ago)
- Last Synced: 2024-04-18T03:52:14.837Z (9 months ago)
- Language: TypeScript
- Homepage: https://stackblitz.com/edit/stackblitz-starters-kfmrzz
- Size: 39.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nextjs multi cookie with same name bug
this repo provides a re-production of nextjs multi cookie bug.
when set multi cookie with same name, it would merged into one `set-cookie` header, then when response to client, only the last one remains
## Re-Production
```
yarn
yarn dev
```then open `${host}/api/test`, open dev-tools or read terminal output, you would find `set-cookie` headers.
### Expected
```
set-cookie: session=1713406956812; Path=/; Domain=.example1.com; Secure; HttpOnly; SameSite=none
set-cookie: session=1713406956812; Path=/; Domain=.example2.com; Secure; HttpOnly; SameSite=none
```### Current
```
## server response
set-cookie: session=1713406956812; Path=/; Domain=.example1.com; Secure; HttpOnly; SameSite=none, session=1713406956812; Path=/; Domain=.example2.com; Secure; HttpOnly; SameSite=none## dev-tools response header
Set-Cookie: session=1713407480483; Path=/; Domain=.example2.com; Secure; HttpOnly; SameSite=none
```