In the following snippet,uSession.isNew
always returns false. Why is that ? I create a new session but the corresponding method returns false
.
HttpSession uSession = request.getSession();
if(uSession.isNew()) {System.out.println("Inside if statement---------");
uSession.setAttribute("username", username);
uSession.setMaxInactiveInterval(3600);
RequestDispatcher dispatcher = request.getRequestDispatcher("User.jsp");
dispatcher.forward(request, response);
}
I have even tried after deleting all the localhost cookies from the browser.