If you store the session in external storage, then after restarting it should be available.
Passport is not responsible for the sessions. You set up a session regardless of the passport in express. A passport is an authentication middleware that uses a session use strategy. you are setting up an express session:
app.use(express.session(session options));
after which you start and set the passport to use the session:
app.use(passport.initialize()); app.use(passport.session());
This means that whether you use a passport or not, the session configuration will be the same.
There are several ways to make sessions persistent: Most of them store the session in db or in the file system (memory is stored only in dev env). Have a look at this npm link search list.
List of compatible session stores from the official page of the express session https://github.com/expressjs/session#compatible-session-stores
The Jwt icon, if properly implemented, is stateless. This means that your server does not store session data, it does not know how many sessions are valid. It resolves the request if it has a valid jwt token.
The Jwt icon may store some data, such as your user ID. When your server receives a token, it decodes it and checks, then you have access to data from this token. Please read this article for more details:
https://stormpath.com/blog/jwt-the-right-way/
The most important parts (there are more important things, but sometimes they are forgotten):
Always verify your signature before trusting any information in the JWT
and
Do not contain sensitive data in JWT
Please see this module for jwt support:
https://www.npmjs.com/package/json-web-token
or even for some hybrid module (redis session with jwt token):
https://www.npmjs.com/package/jwt-redis-session