title: Cookies sent from backend but not set correctly on frontend
body: <p>I'm running into this issue:</p>
  <ul>
  <li>localhost:3000 (React App)</li>
  <li>localhost:9000 (Nodejs Backend)</li>
  </ul>
  <p>I was able to send the request from postman and receive the cookies there, however in the frontend when I check for the cookies in the browser there is nothing.</p>
  <p>The cookies are not visible under the Application &gt; Cookies tab.</p>
  <p>The code I use for handing signups and sending the cookie:</p>
  <pre><code>// requirements
  const User = require('../models/User');
  const jwt = require('jsonwebtoken');
  
  // handle errors
  const handleErrors = (err) =&gt; {
      console.log(err.message, err.code);
      let errors = { first_name: '', last_name: '', email: '', password: '' };
  
      // duplicate error code
      if (err.code === 11000) {
          errors.email = 'That email is already registered';
          return errors;
      }
  
      // validation errors
      if (err.message.includes('User validation failed')) {
          Object.values(err.errors).forEach(({ properties }) =&gt; {
              errors[properties.path] = properties.message;
          });
      }
      return errors;
  }
  
  const maxAge = 3 * 24 * 60 * 60;
  const createToken = (id) =&gt; {
      return jwt.sign({ id }, 'Dummy Secret', {
          expiresIn: maxAge
      });
  }
  
  // module exporting
  
  module.exports.signup_post = async (req, res) =&gt; {
      const { first_name, last_name, email, password } = req.body;
      
      try {
          const user = await User.create({ first_name, last_name, email, password });
          const token = createToken(user._id);
          res.cookie('jwt', token, { httpOnly: true, maxAge: maxAge * 1000 });
          res.status(201).json({ user: user._id });
      }
      catch (err) {
          const errors = handleErrors(err);
          res.status(400).json({ errors });
      }
  };
  </code></pre>
  <p>If anyone could guide me on what to do I'd be grateful</p>
  <p><strong>UPDATE:</strong>
  I did some testing and the results were as follows:
  when I ran this code in the main app.js on the backend and send a request from the front end, the cookies were still messed up, so it might very well be the frontend.</p>
  <pre><code>app.get('/set-cookies', (req, res) =&gt; {
      res.cookie('newUesr', false);
      res.cookie('isEmployee', true, { maxAge: 1000 * 60 * 60 * 24, httpOnly: true});
  
      res.send('you got the cookies!');
  });
  
  app.get('/read-cookies', (req, res) =&gt; {
  const 
  
  });
  </code></pre>
  <p>But when I do it through my controllers in the previously shown code it gets stuck in set cookies as shown in this <a href="https://cdn.discordapp.com/attachments/938088944397074432/940659778970075167/unknown.png" rel="nofollow noreferrer">picture</a></p>