Quantcast
Channel: Active questions tagged https - Stack Overflow
Viewing all articles
Browse latest Browse all 1519

Debugging cookie issues in Next.js: SameSite=None not applying on HTTPS localhost

$
0
0

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:

  1. Set up HTTPS for localhost
  2. Configured the cookie with httpOnly, SameSite=None, and Secure attributes
  3. Verified the cookie is present in the Set-Cookie header of the server response
  4. Checked and confirmed Chrome settings allow third-party cookies
  5. Added the server domain to the list of allowed sites for third-party cookies

Viewing all articles
Browse latest Browse all 1519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>