title: CookieParser and CookieSession middleware in expressjs
body: <p>I am trying to use cookieSession middleware in expressjs app. Is cookieParser middleware required to use before cookieSession middleware? Also cookieParser accepts secret key so do the cookieSession middleware. Do i need to set secret in both? </p>
  
  <pre><code>var express = require('express');
  var app = express();
  app.use(express.cookieParser('secret'));
  app.use(express.cookieSession({
    key: 'key',
    secret: 'Should it be same as above?'
  });
  </code></pre>
  
  <p>I do know that cookieSession middleware assigns cookie variable to req.sesison object. So I guess cookieParser is required but where should i be setting secret, Should I set same secret in both? </p>