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.


response.setDateHeader("Expires", 0); //prevents caching at the proxy server
<script type="text/javascript">
my page body
<form action="validation.jsp">
<input type="submit">

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

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.

Ehmm why to mess with cookies when you can use power of session?