I am writing my SPring MVC web application.
I set the session time of the session to 10080 minutes, equal to 1 week. Now I would like the user to register every time he opens the browser:
sessionService.setcurrentUser(myuser);
HttpSession session = request.getSession();
Cookie cookie = new Cookie("JSESSIONID", session.getId());
cookie.setMaxAge(timeout);
response.addCookie(cookie);
Should my Max Age cookie be the same as the session time?
cookie.setMaxAge(10080);
Is this a good practice?
source
share