title: Setting a cookie in express is not working across localhost domains
body: <p>I have the following two endpoints on my express server:</p>
  <pre><code>api.get(
    &quot;/register&quot;,
    asyncMiddleware( async (req, res) =&gt; {
      res.cookie(&quot;TEST&quot;, &quot;value&quot;, {});
      res.sendStatus(200);
    })
  );
  
  api.get(
    &quot;/home&quot;,
    asyncMiddleware( async (req, res) =&gt; {
      console.log(req.cookies);
      res.sendStatus(200);
    })
  )
  </code></pre>
  <p>I'm hosting the above endpoints at <code>localhost:3010</code>. I'm also running a front-end server that's hosted on <code>localhost:3000</code>. When I call the <code>/register</code> endpoint from the front-end, and then call the <code>/home</code> endpoint, the <code>console.log(req.cookies)</code> comes back with an empty object. However, calling the <code>/register</code> endpoint from <code>localhost:3010</code> will set the cookie as intended, and the console log will show the correct value.</p>
  <p>Are there any special steps I need to take to get cookies working across domains in Express? I've looked around the documentation and couldn't follow anything relevant.</p>