title: How to set secure cookie using heroku + node.js + express?
body: <p>I have a node.js app running on the Cedar stack and I'm puzzled why secure cookies don't work.</p>
  
  <pre><code>"express": "3.0.3",
  "node": "&gt;=0.8.14",
  
  ...
  app.use(express.session({
          secret : 'somesecret',
          store : // store works fine, sessions are stored
          key : 'sid',
          cookie : {
              secure : true, // it works without the secure flag (cookie is set)
              proxy : true,  // tried using this as well, no difference
              maxAge: 5184000000 // 2 months
          }
  }));
  ...
  </code></pre>
  
  <p>On localhost everything works fine, but on heroku I don't seem to be able to set a secure cookie. What am I doing wrong? The <a href="https://devcenter.heroku.com/articles/http-routing">docs</a> say the load balancer terminates SSL, is it something to configure over there?<br>
  thanks a lot</p>