title: Disabling sessions in nodejs Passport.js
body: <p>I just discovered about <a href="https://scotch.io/tutorials/authenticate-a-node-js-api-with-json-web-tokens#introduction" rel="noreferrer">Tokens for authentication</a> which allows session/stateless servers and starting out with MEAN. Looks amazing.</p>
  
  <p>Right now, I'm using <code>Passport.js</code> to authenticate users (via Email, Facebook, Google,...), which stores information into the server session like all the tutorials say:</p>
  
  <pre><code> // required for passport
      app.use(express.session({
          secret : 'superscret',
          expires: new Date(+new Date + settings.session.sessionTimeout),
          store: new MongoStore({})
      })); // session secret
      app.use(passport.initialize());
      app.use(passport.session({}));
  </code></pre>
  
  <p>Is it possible to still use <code>Passport.js</code> but instead of storing the session, sends back a token to monitor if the user has access. </p>
  
  <p><strong>Question</strong>: How can disable sessions for passport? (I know how to send the token and listen for it). </p>