Hey, all Java & JSP gurus,
i'm developing a website using JSP and MS SQL.
Can you please tell me the code to invalidate a session object i.e. the code for logout (to be written in JSP)
Following is my code for creating session object, on login:
HttpSession ses=request.getSession(true);
ses.setAttribute("Name",name);
i'm using the same session object to validate user status on all pages using -
Object obj=(session.getAttribute("Name"));
String sesVar=obj.toString();
if (sesVar != null)
{
//display page
}
else
{
<jsp:forward page="Error.jsp" />
}
Please Tell me the logout code.
Any suggestions are most welcome.
Thank you.