0

I want to log out from my the account in my project . So i wrote an jsp code as below

<%@page import="java.util.*" %>
<%session.invalidate();%> You have logged out. Please <a href="adminlogin.html"><b>Login</b></a>

but whenever i click on browser back button it's going to the main admin page but it should not go back to the previous page . I should disable the browser from going to the admin main page . It should only happen through log in. please help me***

Jodes
  • 14,118
  • 26
  • 97
  • 156
venkat
  • 77
  • 3
  • 11
  • Use [filter](http://stackoverflow.com/questions/3177733/how-to-avoid-java-code-in-jsp-files) instead of write code in JSPs. – KV Prajapati Mar 12 '13 at 04:31

1 Answers1

0

try this

<SCRIPT type="text/javascript">
    window.history.forward();
    function noBack() { window.history.forward(); }
</SCRIPT>
</HEAD>
<BODY onload="noBack();"
    onpageshow="if (event.persisted) noBack();" onunload="">

see here

PSR
  • 39,804
  • 41
  • 111
  • 151