How to kill session
Hi gang ,
I want to know how to kill session when I click the Back button , after entering into the Login Page.
>> I start my Tomcat server.
http://localhost : 8080
>> I then invoke my application in the url as :
http://localhost:8080/xaltforms22/index.jsp
>> Then I navigate to other pages in my project , but my, the problem is when I click the Back button in the browserand when I reach the
http://localhost:8080/xaltforms22/index.jsp
and again when I click backI should not get the Tomcat server page
Hi ,
I now I can use Java Script but it doesnt work for all browsers .
window.history.go("1") ;-- for IE
(and)
window.history.forward("1") ;for FF(Fire Fox).
But I want to use jsp to kill my session Id , like session.invalidate();
I usually write this method in init() method ,but my project does not have
init() method .
So Can u help me in getting this done .
> I want to use jsp to kill my session Id , like
> session.invalidate();
> usually write this method in init() method ,
>but my project does not have
> t() method .
That doesn't make sense. The init() method is called once, when the servlet is initialized (by the servlet container).I don't see how invalidating session there would help in any way when the user hits the back button.
BTW, the equivalent of a servlet's init() method is jsp_init() . When a JSP is compiled into a servlet, the code you write in jsp_init will be placed inside the generated servlet's init() method.
Back to your problem, you might consider other less drastic (and smarter) alternatives to solve the (classic) back button problem, like redirecting after post. A little research on the internet should give you some material.