title: nodejs express req.session not storing my variable
body: <p>I'm setting a basic admin auth, when the user is logged in, I call this function in the authcallback :</p>
  
  <pre><code>function checkAdmin (req) {
    Admin.findOne( { user : req.user.id },function ( err, admin, count ){
      req.session.isAdmin = true;
      console.log("session : %j",req.session);
    })
  }
  </code></pre>
  
  <p>And then I do</p>
  
  <pre><code>res.redirect('/')
  </code></pre>
  
  <p>The code inside the index controller :</p>
  
  <pre><code>console.log("session : %j",req.session);
    res.render('index', { title: 'Accueil',message: req.flash('info') });
  </code></pre>
  
  <p>And this is what I get in the console :</p>
  
  <pre><code>session : {"cookie":{"originalMaxAge":null,"expires":null,"httpOnly":true,"path"
  :"/"},"passport":{"user":"5079832df1e9a6485e000001"},"flash":{},"isAdmin":true}
  
  session : {"cookie":{"originalMaxAge":null,"expires":null,"httpOnly":true,"path"
  :"/"},"passport":{"user":"5079832df1e9a6485e000001"},"flash":{}}
  </code></pre>
  
  <p>I don't get why the session doesn't store the isAdmin value.</p>
  
  <p>I've read some other questions saying that the app.use(app.router) place could be a cause but I do :</p>
  
  <pre><code>app.use(cookieParser)
  app.use(express.session({store: session_store }));
  app.use(passport.initialize())
  app.use(passport.session())
  
  
  // routes should be at the last
  app.use(app.router)
  </code></pre>
  
  <p>It must be kind of idiot I guess ..</p>