I build authentication system in my express.js app with passport.js (LocalStrategy). Here's my Node.js middleware responsible for session:
app.use(
session({
secret: "secretcode",
resave: true,
rolling: true,
saveUninitialized: false,
cookie: { secure: false, expires: 1000 * 60 * 30 } /* Session expire in 30 minutes */
})
);
Everything works fine (I tested it, when I change 1000 * 60 * 30 to 1000 * 60 * 30 I was logged out after one minute of idle time), except of the fact that my clients complain that there're logged out after 3-5 minutes of idle time. Is this possible and - if yes - what could be the reason for that? Browser settings? Two users logged in simultaneously and one of them logged out?