title: Node.js - writeHead to set both "Location" and "Set-Cookie"
body: <p>In node.js(running this in Connect.js), I am able to set ether the Location or Set-Cookie with writehead, but not both at the same time. Currently, the below sets the cooke but the URL does not get redirected to the new location:</p>
  
  <pre><code>function foo(req, res, next) {
      var url = /container-templates/;
      if (url.test(req.url)) {
          console.log(url.test(req.url));
          console.log(req.url);
          res.writeHead(302, ["Location", 'https://staging.dx.host.com' + req.url],
                  ["Set-Cookie", "fake-token=5b49adaaf7687fa"]);
          res.end();
      } else { next() }
  }
  </code></pre>
  
  <p>On a side note, I am doing this for the learning experience and do not want to use any pre-written plugins. </p>