title: Req.headers.cookie is empty, even with cookies in request headers
body: <p>With Express I have the following setup:</p>
  
  <pre><code>const express = requires("express");
  const path = requires("path");
  const bodyParser = requires("body-parser");
  const cookieParser = requires("cookie-parser");
  
  let server = express();
  server.set("port", (process.env.PORT || 5000));
  server.set("views",  path.join(__dirname, "/views"));
  server.set("view engine", "ejs");
  server.use(cookieParser());
  server.use(express.static(self.workingDirectory + "/public"));
  server.use(bodyParser.json());
  server.use(bodyParser.urlencoded({ extended: true }));
  server.use((req, res, next) =&gt; {
      // if req.cookies exists and testcookie is undefined within req.cookies
      if ( req.cookies &amp;&amp; typeof req.cookies["testcookie"] === "undefined" ) {
          console.log("Setting cookie! Testcookie was not found");
          res.cookie("testcookie", "test", {
              maxAge : ((((1000*60)*60)*24)*7), /* expire a week from today */
              httpOnly: true /* document.cookie doesn't return this cookie */
          });
      }
      next();
  });
  server.get("/", (req, res) =&gt; { res.render("pages/index"); });
  server.listen(server.get("port"), () =&gt; { console.log("Server started!"); });
  </code></pre>
  
  <p>So when I visit <code>/</code> the cookie is set as appropriate, but on every visit after that it keeps getting set. Later when I run <code>console.log(req.headers)</code> 
   through a new middleware it displays the following on every visit to <code>/</code>, even though the cookie should've been set:</p>
  
  <p><a href="https://i.stack.imgur.com/93SJa.png" rel="noreferrer"><img src="https://i.stack.imgur.com/93SJa.png" alt=""></a></p>
  
  <p>The response headers have the cookie in them:</p>
  
  <p><a href="https://i.stack.imgur.com/nJnDu.png" rel="noreferrer"><img src="https://i.stack.imgur.com/nJnDu.png" alt=""></a></p>
  
  <p>Am I doing something wrong here? I can't figure out what's wrong... Isn't <code>cookie-parser</code> meant to populate <code>req.cookies</code> with cookies from the <code>req.headers.cookie</code> property? Why is <code>req.headers.cookie</code> returning empty. <code>req.headers.cookie</code>also returns empty if I comment out anything to do with <code>cookie-parser</code>.</p>