Save session after restarting java browser
I am working on a small project using java servlets / jstl
I have created a login with a session and I want the browser to persist this session even after the browser.
I wrote this code:
HttpSession session=request.getSession();
session.setMaxInactiveInterval(604800);
session.setAttribute("loggedOnUser", true);
I have set the session timeout to a week. But whenever I close my browser and reopen it, I need to login again. When I look at my browser's cookies, the cookie containing the sessionId still expires when the browser is closed. I thought that "setMaxInactiveInterval" would change this for one week. Does anyone know what the problem is?
+3
source to share