Back Button Disable on browser window after logged out
When i logged out from my application , i realised that even after expiring all session variables and everything ,i can go back in application using window’s Back Button and that i think isĀ insecure because anyone can go in and play with your data and can cause problems for you.
But Not any more..Here is the solution for this problem.
We don’t actually disable the Window’s back button because we can’t do that but alternatively we can stop user going back to our web page after logging out.
Ok..so First Step :
When you click EXIT you wants to goto main.html…But we won’t goto main.html directly ,we will go via middle page ..say middle.html
Here is your middle.html
<html>
<head>
<meta http-equiv=“Content-Type” content=“text/html; charset=windows-1252″>
<title>Title Page</title>
<meta name=“GENERATOR” content=“Microsoft FrontPage 4.0″>
<meta name=“ProgId” content=“FrontPage.Editor.Document”>
<script language=“javascript”>
window.location=”main.html”
window.history.forward(0);
</script>
</head>
<body >
<table width=98% align=center>
<td align=center>
<IMG border=0 id=IMG2 src=“images/ban_gen.gif” align=center valign=top>
</td></table>
<table width=98% align=center class=tcs>
<td align=center>
You have successfully logged out of the system
</td></table>
</body>
</html>
When you click EXIT point to middle.html , which then forwards you to main.html and now you can try using back button , which won’t allows you to go back to your page.
Hope That solves your problem -:)
Categories: Javascript Tags: Browser Back Button, Javascript