title: Express: fetch unable to set cookie
body: <p>I use the below to set a cookie using express.</p>
  
  <pre><code>app.use(require('cookie-parser')());
  app.get('/a', function (req, res) {
      console.log(req.cookies);
      res.cookie('aaa', 'bbb');
      res.send('something');
  });
  
  app.post('/b', function (req, res) {
      console.log(req.cookies);
      res.cookie('ccc', 'ddd');
      res.send('something');
  })
  </code></pre>
  
  <p>If visit directly a, can set cookie.</p>
  
  <pre><code>&lt;form method="POST" action="/bb"&gt;
      &lt;label&gt;name&lt;/label&gt;
      &lt;input type="submit" value="login" /&gt;
  &lt;/form&gt;
  &lt;div id='test'&gt;fetch&lt;/div&gt;
  &lt;script&gt;
      var test = document.getElementById('test');
      test.onclick = function () {
          fetch('/b', {
              method: 'POST'
          }).then( (data) =&gt; {
              data.text().then(function(data) {console.log(data)});
          })
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>If click submit, can set cookie,
  But if click test, can not set cookie.</p>
  
  <p>Why? </p>