Open janson opened 2 months ago
Thank you for providing the repro for the Vercel deploy
Bug also observed with the official doc's cookie+middleware example
Can you attach a repository reproducing that behavior?
Hi @eps1lon sure thing:
https://github.com/janson/nextjs-cookies-middleware-vercel
Just visiting the homepage in the browser sets the 'vercel' cookie three times.
Link to the code that reproduces this issue
https://github.com/janson/nextjs-cookies-middlware/tree/main
To Reproduce
Current vs. Expected behavior
Expected
A single console log message,
***** Setting cookie: experiments *****'
is displayed when the cookie is set upon first visiting/demo
. No repeated message until the cookie is deleted or expired.Current Cookie is set several times upon first visiting the
/
page. And again when visiting/demo
.Provide environment information
Which area(s) are affected? (Select all that apply)
Middleware
Which stage(s) are affected? (Select all that apply)
Vercel (Deployed), Other (Deployed)
Additional context