title: Cookies doesn't work with Cross-site config. I'm using React (Next.js) and Node.js (Express)
body: <p>I'm working in an app with React with Next.js in the frontend and Node.js with Express in the backend.
  My login works with cookies, in localhost all works better, but when I make the deploy, I have two apps. My frontend app is deployed in now.sh and My backend app is deployed in Heroku. When I try to make a login request in production, all works fine, the cookies are in the response and the header 'Set-Cookie' exists. But my browser (Chrome) doesn't store the cookie in Application &gt;&gt; Cookies and obviously my frontend app doesn't know about the cookie and it's undefined</p>
  <p><strong>Here is my code:</strong></p>
  <p><strong>Server.js</strong></p>
  <pre><code>app.use(
    cors({
      credentials: true,
      origin: process.env.CLIENT_URL, // contains the frontend url
      methods: [&quot;GET&quot;, &quot;POST&quot;, &quot;PUT&quot;, &quot;PATCH&quot;, &quot;DELETE&quot;, &quot;HEAD&quot;, &quot;OPTIONS&quot;],
      allowedHeaders: [&quot;Content-Type&quot;, &quot;Authorization&quot;],
    })
  );
  </code></pre>
  <p><strong>Auth routes when I make the response to the frontend</strong></p>
  <pre><code>return res
        .cookie(&quot;token&quot;, session.token, {
          httpOnly: true,
          sameSite: &quot;None&quot;,
          maxAge: 1209600000,
          secure: process.env.NODE_ENV === &quot;production&quot;,
        })
        .status(200)
        .json({
          success: true,
          token: session.token,
          user,
        });
  </code></pre>
  <p><strong>Making the request in the frontend</strong></p>
  <pre><code>const { data } = await Axios.post(login, // backend url to make the request
        { email, password },
        { withCredentials: true });
  </code></pre>
  <p><strong>Response in the browser</strong></p>
  <p><img src="https://i.stack.imgur.com/Orwop.png" alt="" /></p>
  <p><strong>Cookie info in the cookie tab</strong></p>
  <p><img src="https://i.stack.imgur.com/gx7k5.png" alt="" /></p>