title: nodejs express req.session undefined
body: <p>Just can't figure this one out. Everything I find about express session says pretty much it just works, that, however, is not the case for me.</p>
  
  <p>My whole app configuration</p>
  
  <pre><code>app.configure -&gt;
    app.set 'port', process.env.PORT || 3000
    app.set 'views', path.join(__dirname, 'views')
    app.set 'view engine', 'jade'
    app.use express.favicon()
    app.use express.logger('dev')
    app.use express.json()
    app.use express.urlencoded()
    app.use express.methodOverride()
    app.use app.router
    app.use express.static(path.join(__dirname, 'public'))
    app.use express.bodyParser()
    app.use express.cookieParser()
    sessionStore = new express.session.MemoryStore
    app.use express.session secret: 'key', store: sessionStore
  </code></pre>
  
  <p>But the <code>req.session</code> is just <code>undefined</code>. I want to use it for user authentication - pretty basic. For some reason it turns out pretty tough for me.</p>
  
  <p>I am using <code>express 3.5.0</code>.</p>
  
  <p>My controller atm looks like this:</p>
  
  <pre><code>class AuthenticationController
  
    signUp: (req, res) -&gt;
      console.log req.body._id
      console.log req.session
      res.status(200).send req.body
  
  module.exports = AuthenticationController
  </code></pre>
  
  <p>and routes:</p>
  
  <pre><code>format = require './middlewares/format'
  AuthenticationController = require './controller'
  
  class Routes
  
    constructor: (app) -&gt;
      throw new Error('app undefined') unless app
      @controller = new AuthenticationController
      @app = app
      route.apply @ for key, route of @routes
  
    routes:
      sign_up: -&gt;
        @app.post '/sign_up', format.onlyJSON, @controller.signUp
  
  module.exports = Routes
  </code></pre>