I need to end the session automatically when the user is inactive for some particular time say for 10 minutes. We have a method in
HttpSession session=reque
Question: How to end sessions automatically if user closes the browser? Answer: Set max inactive interval time value less than 0.
Example:
HttpSession session = request.getSession(); session.setMaxInactiveInterval(-1); session.setAttribute("User", au); response.sendRedirect("doLogin.jsp");