title: Understanding passport serialize deserialize
body: <p>How would you explain the workflow of Passport's serialize and deserialize methods to a layman.</p>
  
  <ol>
  <li><p>Where does <code>user.id</code> go after <code>passport.serializeUser</code> has been called?<br></p></li>
  <li><p>We are calling <code>passport.deserializeUser</code> right after it where does it fit in the workflow?</p>
  
  <pre><code>// used to serialize the user for the session
  passport.serializeUser(function(user, done) {
      done(null, user.id); 
     // where is this user.id going? Are we supposed to access this anywhere?
  });
  
  // used to deserialize the user
  passport.deserializeUser(function(id, done) {
      User.findById(id, function(err, user) {
          done(err, user);
      });
  });
  </code></pre></li>
  </ol>
  
  <p>I'm still trying to wrap my head around it. I have a complete working app and am not running into errors of any kind.</p>
  
  <p>I just wanted to understand what exactly is happening here?</p>
  
  <p>Any help is appreciated.</p>