Here's an English translation of your question, suitable for posting on Stack Overflow:
Title: Cookie not being set in localhost environment with Next.js app
I'm trying to test cookies in a localhost environment for a web app built with Next.js. I've sent a cookie from the server with the following attributes:
httpOnly;SameSite=None;Secure;
The cookie is correctly included in the response header's Set-Cookie attribute. I'm also running localhost over HTTPS.
However, the cookie is not being applied in the browser. Consequently, it's not visible in the browser's Application - Cookies tab.
I've checked Chrome's settings related to third-party cookies, and they are set to allow third-party cookies. As an additional measure, I even added the server's domain to the list of sites allowed to use third-party cookies.
Despite all these attempts, I haven't been successful in getting the cookie to appear. Am I missing something?
Here are the steps I've taken so far:
- Set up HTTPS for localhost
- Configured the cookie with httpOnly, SameSite=None, and Secure attributes
- Verified the cookie is present in the Set-Cookie header of the server response
- Checked and confirmed Chrome settings allow third-party cookies
- Added the server domain to the list of allowed sites for third-party cookies