title: Safari not setting a cookie from Node.js back-end
body: <p>I have the following scenario with both my FE and BE hosted on Heroku's free dynos.</p>
  <p>My Express BE sets a cookie in the following way on POST Login request:</p>
  <pre><code>router.post('/login', isGuest, async (req, res) =&gt; {
  const { email, password } = req.body;
  try {
   let { token, userId, userEmail, userAvatar } = await authService.login({
     email,
     password,
   });
  
   res.status(200).json({
     userId,
     userEmail,
     userAvatar,
   });
   res.cookie(AUTH_COOKIE_NAME, token, {
     secure: true,
     sameSite: 'none',
   });
   } catch (error) {
     res.status(500).json({ message: error.message });
   }
  });
  </code></pre>
  <p>This is my CORS configuration:</p>
  <pre><code>const corsConfig = {
   credentials: true,
   origin: true,
  };
  </code></pre>
  <p>This works great on Chrome and FF, but on Safari the cookie is not being set. I read through all the issues on Safari not being able to set cookies and tried to specify a domain in the cookie. I also tried chaining the response answer like this <code>res.cookie(...).status(200).json()</code> but still had no luck.</p>
  <p>Any ideas on what should I change so I can set the cookie successfully on Safari too?</p>
  <p>If I can add any further information that could be helpful let me know.</p>