title: req.isAuthenticate() always return false after deploy on Firebase
body: <p>I've created the classic to-do app with a registration and login. All works fine, except authentication, but only after deploying on firebase (on localhost is perfect).</p>
  <p>For this app, I use these dependencies</p>
  <pre><code>const functions = require('firebase-functions');
  const express = require('express');
  const bodyParser = require('body-parser');
  const ejs = require('ejs');
  const mongoose = require('mongoose');
  const passport = require('passport');
  const session = require('express-session');
  const passportLocalMongoose = require('passport-local-mongoose');
  const MongoStore = require('connect-mongo');
  </code></pre>
  <p>I'll explain better: I can register a new user correctly, and I can find the new record on the database, but after that when the user has redirected to the homepage, the condition of the authentication results is false and I've been redirected to the login page.</p>
  <p>This is the express-session configuration</p>
  <pre><code>    app.use(session({
          secret: process.env.SESSION_KEY,
          resave: true,
          saveUninitialized: false,
          store: MongoStore.connect({mongoUrl: uri})
      }));
  
  app.use(passport.initialize());
  app.use(passport.session());
  </code></pre>
  <p>The condition to have redirected only if the user is authenticated</p>
  <pre><code>app.get('*', function(req, res, next){
  
      if(!req.isAuthenticated()) {
          if(req.path != &quot;/login&quot; &amp;&amp; req.path != &quot;/register&quot;){            
               res.redirect('/login');
      }}
      next();
      
  });
  </code></pre>
  <p>The login and registration post request</p>
  <pre><code>//=================REGISTRATION==================
  
  app.post(&quot;/register&quot;, function(req, res){
  
      User.register({username: req.body.username, name: req.body.name}, req.body.password, function(err, user){
          if(err){
              console.log(err);
              res.redirect(&quot;/register&quot;);
          } else {
  
              passport.authenticate(&quot;local&quot;)(req, res, function(){
                  res.redirect(&quot;/&quot;);
              });
          }    
  
      });
  
  });
  
  //=================LOGIN==================
  app.post(&quot;/login&quot;, function(req, res){
  
      const user = new User({
          username: req.body.username,
          password: req.body.password
      });
  
      req.login(user, function(err){
          if(!err){
              passport.authenticate(&quot;local&quot;)(req, res, function(){
                  res.redirect(&quot;/&quot;);
              });
          }
      });
  });
  </code></pre>
  <p>I've tried almost every other similar StackOverflow answer but always the same or a timeout error...
  I look at the console log of google cloud but no error or particular message...</p>
  <p>thanks to all who help me</p>