title: Save cookies using cookie-parser and nodejs
body: <p>I'm trying to save cookies using nodeJS and no luck</p>
  <p>my code:</p>
  <p>on app.js:</p>
  <pre><code>const cookieParser      = require('cookie-parser');
  const session           = require('express-session');
  app.use(cookieParser());
  </code></pre>
  <p>and then on index.js I'm trying to save order(which is an array of objects to a cookie:</p>
  <pre><code>router.post(&quot;/order&quot;, async function(req, res){
   order.push({data: req.body.order});
   var orderDetails = JSON.stringify(order);
      res.cookie('orderDetails', orderDetails, { maxAge: 60 * 60 * 2});
  ...
  ...
  ...
  </code></pre>
  <p>But no cookie is stored in the browser</p>
  <p>How can I fix that?</p>