0

hi
I have a simple log in form.
I want that after user logs in , he should not be able to goto login page again using back button of browser.
Does page reloads fresh when back button is clicked or it simply displays what was earlier.

login.jsp

<%
response.setHeader("Cache-Control","max-age=0");
response.setHeader("Pragma","no-cache");
response.setDateHeader("Expires", 0); //prevents caching at the proxy server
%>
<script type="text/javascript">
alert("hi");
</script>
<HTML>
<HEAD> 
</HEAD> 
<BODY>
my page body
<form action="validation.jsp">
<input type="submit">
</form>
</BODY>
</HTML>

If user clicks back button of browser , alert("hi") is not executed.it means it simply display the last page.

How can i prevent this.
Thanx in advance

3
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by peter_budo
0

Read a cookie in login page, Redirect the user if cookies is found. If cookie is not found then allows user to submit username, andpassword. Once, user is authenticated by your system then create a cookie.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.