views:

2047

answers:

3

I am using basic level authentication and I need best logout code in JSP/Servlet. I am using JSP & servlet and MS-Access as backend.

Is it required to create session in JSP?

+2  A: 

if you are wanting to "logout" of the application, try:

request.getSession().invalidate();

adam
A: 

request.getSession().invalidate(); will not work allowes... so 1 step after succesfull login time set a session session.setAttribute("loginstatus","true"); on logout set that value "false";

and for after login page include a authentication.jsp which allowes check the ststus of "loginstatus" session if it is false then it forward control to before login page....I think it will work...

sourav nandan
Huh? Why would it not work? Is the login information stored beyond the scope of the session? That would have caused other (and more serious) problems.
BalusC
A: 

true, false is the best method i done it

bhathiya