How to preserve logged in state when server restarts / shuts down?

Hi there,

I am using auth0/nextjs and this great guide from @bruno.krebs to add authentication to my app.

Thing is, my integration works great but after restarting my node server it is not having a session locally and I look logged out. It is not a matter of expiration as I am doing it in a gap of seconds. If I attempt a login, it recovers fine, without even asking for credentials.

Also, I am using a session manager already, as instructed in the tutorial.

const sessionConfig = {
  secret: uid.sync(18),
  cookie: {
    maxAge: 86400 * 1000
  },
  resave: false,
  saveUninitialized: true
};
server.use(session(sessionConfig));

So, is this related to nextjs-passport? Any ideas on how to overcome it?

Thanks,
P.