I am facing very strange problem while developing JavaEE WEB Application.
Even after invalidating the HttpSession using session.invalidate();
HttpSession
session.invalidate();
Try passing false as the parameter to the getSession(boolean) . This will give back a session if it exists or else it will return null.
HttpSession session = request.getSession(false); if(session==null || !request.isRequestedSessionIdValid() ) { //comes here when session is invalid. }