I have a node application and whenever I edit/update a .js file, users are logging out. I'm using passport-local with express.io.
Also I'm using mongoose and socket.io.
app.configure(function() {
app.use(express.logger('dev'));
app.use(express.cookieParser());
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.set('view engine', 'ejs');
app.use(express.session({
key: 'session',
secret: '111'
}));
app.use(passport.initialize());
app.use(passport.session());
app.use(flash());
});
How to make users log in forever?
If you want to keep alive the session restarting node you need a session storage. The default session storage stores data into ram and it's lost at every node restart.