Description
I am using Spring Session v1.2.1 with Postgres. The sessions are persisted into my Postgres database using the JdbcOperationsSessionRepository
.
The default inactive time that I am using for my sessions is 30 days. Once a user logs in, I do request.getSession().setMaxInactiveInterval()
and change it to 180 days.
However for some reason the 180 days is not being respected and sessions keep getting deleted every hour. For example:
This session should have lasted 180 days but it got deleted as soon as the next hour started.
Does anyone know how I can stop these sessions from getting deleted and have them stick around for 180 days?
I am guessing this function has something to do with this.
Here's the part of my application that extends the user's max inactive interval:
private void setupSession(HttpServletRequest request, User user) {
HttpSession session = request.getSession();
session.setMaxInactiveInterval(15552000);
session.setAttribute("user-id", user.id);
}