I'm writing my SPring MVC web application.
I have set my session time out to be 10080 minutes equal to 1 week. Now I would like to keep user logged in every time he open browser:
sessionService.setcurrentUser(myuser);
HttpSession session = request.getSession();
Cookie cookie = new Cookie("JSESSIONID", session.getId());
cookie.setMaxAge(timeout);
response.addCookie(cookie);
Should my cookie Max Age be the same as session time out?
cookie.setMaxAge(10080);
Is it good practice?