title: Cookies undefined on node js/express (localhost)
body: <p>A Newbie question I guess. I want to set and get cookies on my express site. </p>
  
  <p>cookieParser is set up and seems to run. But my cookies are always undefined. So what can be wrong? Doesn't cookies work on localhost?
  I can access all cookies in the console on chrome. </p>
  
  <p>I have tried both httpOnly: false/true.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>var express = require('express'),
      exphbs = require('express-handlebars'),
      bodyParser = require('body-parser'),
      cookieParser = require('cookie-parser'),
      request = require('request'),
      livereload = require('express-livereload'),
      port = Number(process.env.PORT || 3000);
  
  var log = require('./lib/log.js'));
  
  var app = express();
  
  livereload(app, config = {watchDir: process.cwd()});
  
  app.engine('handlebars', exphbs({defaultLayout: 'main'}));
  app.set('view engine', 'handlebars');
  
  app.use(express.static('public'));
  app.use(cookieParser());
  app.use(bodyParser.urlencoded({ extended: true}));
  
  app.get('/', function(req, res) {
  
      res
          .cookie('cart', 'test', {maxAge: 900000, httpOnly: false})
          .render('index');
  
      console.log(res.cookie.cart);
  
  });
  
  
  app.listen(port, function() {
  
      log.clear();
      log.out('Express on http://localhost:' + port);
      log.hr();
  
  });
  </code></pre>
  
  <p>Any clues?</p>