title: passport.js deserializeUser not modifying req.user
body: <p>I am not seeing any effect on the <code>req.user</code> or <code>req.session.passport.user</code> objects as a result of <code>deserializeUser()</code>.</p>
  
  <p>My understanding is that successful completion of <code>deserializeUser()</code> should result in my User object which <em>I</em> retrieve from a DB should be set to the <code>req.user</code> property.  <em>Is this correct?</em></p>
  
  <p>Furthermore, it seems that the purpose of this callback is to allow me to serialize a small object (e.g.:  <code>{username: 'me', email: 'me@me.com'}</code>) in the cookie itself, but then add more user info retrieved from the database to use downstream.</p>
  
  <p>Instead, I see the following:</p>
  
  <pre><code>passport.serializeUser(function(user, done) {
      // user: 'stan@stadelman.com'
      fetchUser(user, function(u) {
          // u: { email: 'stan@stadelman.com', name: 'Stan Stadelman' }
          done(null, u);
      });
  });
  
  passport.deserializeUser(function(id, done) {
      // id: { email: 'stan@stadelman.com', name: 'Stan Stadelman' }
      fetchUser(id.email, function(user) {
          // user: { email: 'stan@stadelman.com', name: 'Stan Stadelman',    local_props: 'from_db'}
          done(null, user);
      });
  });
  
  req.user = 'stan@stadelman.com'
  req.session = { cookie: 
     { path: '/',
       _expires: null,
       originalMaxAge: null,
       httpOnly: true },
    passport: { user: { email: 'stan@stadelman.com', name: 'Stan Stadelman'    } } }
  </code></pre>
  
  <p>My expectation was that the <code>req.session.passport.user</code> and/or <code>req.user</code> objects should contain the <code>local_props</code> property value.  Am I reading the documentation &amp; tutorials incorrectly, or is there an issue?  I've cross-posted in passport.js github <a href="https://github.com/jaredhanson/passport/issues/409" rel="nofollow">here</a>.</p>
  
  <p><em>My express &amp; passport setup is as follows:</em>  </p>
  
  <pre><code>// express configs
  app.use(cookieParser(expressSecret));
  app.use(bodyParser.urlencoded({extended: true}));
  app.use(bodyParser.json());
  app.use(expressSession({ 
      secret: expressSecret, 
      resave: true, 
      saveUninitialized: true }
  ));
  app.use(passport.initialize());
  app.use(passport.session());
  
  // passport implementation
  passport.use(new BasicStrategy(/...));
  </code></pre>