title: Sending cookies to client with express not working
body: <p>My current setup is a Node.js app set up on Heroku, which is supposed to set some cookies for my client (a React app) using Express.js like this.</p>
  
  <pre><code>request.post(authOptions, function(error, response, body) {
    if (!error &amp;&amp; response.statusCode === 200) {
  
      const access_token = body.access_token,
          refresh_token = body.refresh_token;
  
  
  
      let options = {
        url: 'https://api.spotify.com/v1/me',
        headers: { 'Authorization': 'Bearer ' + access_token },
        json: true
      };
  request.get(options, function(error, response, body) {
               res.cookie('access_token',access_token, { domain: 'example.com', path: '/', expires: new Date(Date.now() + 9000000), httpOnly: false });
              res.cookie('refresh_token',refresh_token,{ domain: 'example.com', path: '/', expires: new Date(Date.now() + 9000000), httpOnly: false });
              res.cookie('user',body.display_name,{ domain: 'example.com', path: '/', expires: new Date(Date.now() + 9000000), httpOnly: false });
  
          res.redirect('https://www.example.com/');
       });
  } else {...}}
  </code></pre>
  
  <p>It does set the cookies, but only in the Heroku app. The domain I give is ignored completely, which obviously results in an error when I try to read the cookies on the client side. Any advice?</p>
  
  <p>Edit: Added the full function.</p>