Clear Browser History

Sowjanya Reddy replied to Jobi K John at 08-May-08 12:28
First, set a cookie of any given name and value (as long as it's consistent) and carry it along in your application. On every screen, have a log-out button. When this log out button is pressed, it deletes or resets the value of the cookie to something that indicates logged out.

Now, on your sensitive info pages that you don't want backed into, have some JavaScript that basically checks the cookie to see if it's still there. This Javascript should be in the head or early part of your document. If the JavaScript detects that the cookie is gone or logged-out, then it uses a location.replace() with the URL of some "We're sorry, but you logged out" page.

In this case, if someone backed up to a sensitive post, the JavaScript would run, and the page would immediately be replaced by another webpage, and totally removed from the history



Click here to sign in and reply. You could earn money via our $500 contest just for being helpful.
  Is it possible to clear browser history? - Jobi K John  07-May-08 9:50:32 AM
      This question has been answered here many times. - Peter Bromberg  07-May-08 9:57:19 AM
          Re: - Aravind Kumar  07-May-08 10:02:35 AM
      Clear Browser History - Sowjanya Reddy  08-May-08 12:28:31 AM
          Could you explain it with a sample? - Jobi K John  09-May-08 9:12:19 AM
      Don't cache page and u can't delete any entries of history through javascript - Danish Shaikh  11-May-08 2:54:04 AM
View Posts