session.invalidate causing pblms
843835Nov 29 2001 — edited Dec 1 2001Hi there,
I am having problems in redirection/forwarding after invalidating the session and creating a new one.
The situation is very simple. When user choses to "Logout" the session is invalidated and redirected to the login page again. Now when user tries to log in again, I am getting:
unable to dispatch to the url : NullPointerException.
This is what I tried:
session.invalidate();
session = request.getSession(true);
if ((session != null)&&(session.isNew()))
{
System.out.println("new session created");
response.sendRedirect("first.jsp");
}
else
System.out.println("session not created");
Is is that I cannot redirect after invalidating the session!!!
Doesnt make sense to me.
Suggestions and ideas please,
RG