Disable the BACK button on IE4/5

Results 1 to 3 of 3

Thread: Disable the BACK button on IE4/5

  1. #1
    William Guest

    Default Disable the BACK button on IE4/5

    I need to disable the BACK button so users can&#039t see the previous pages for security reasons. Got any ideas? Thanks in advance.

  2. #2
    Josh Rolfe Guest

    Default RE: Disable the BACK button on IE4/5

    This isn&#039t totally effective, but you could try it:<BR>When your user submits a form or whatever, the action page would be a page that redirects them to the page you want. If they click back, then the page before just keeps redirecting them to the same page. However, your user could just right click on the back button go back two pages, defeating the whole thing.<BR>Unfortunately, the history object in the document object model is read-only, so you can&#039t clear a user&#039s history.<BR>I believe it is possible to do what you want, but not simply. If you are using dll&#039s (for example, isapi.dll) to generate your page, then clicking the back button would rerun the dll, which you could have check for a session variable which tells you they&#039ve already been on the page and redirect them or display a page with some security message. But I can&#039t give you any more details than that, I&#039ve never done it before.<BR>You could try putting &#060;%response.expires=0%&#062; on your page you don&#039t want them to go back to then set a session variable on your other page and have the initial page check for that session variable. I&#039ve tried that with varying results...while this will prevent the browser from pulling the page from the disk cache, sometimes it still pulls the page from the memory cache.

  3. #3
    EDG Guest

    Default RE: Disable the BACK button on IE4/5

    This is somewhat a kludge rather than a real solution, but you might try replacing the hrefs with<BR><BR>&#060;a href="javascript:location.replace(&#039mypage.asp& #039)"&#062;Next page&#060;/a&#062;<BR><BR>This will replace the current history location with what&#039s in the apostrophes (in this case, mypage.asp), effectively preventing the user from accessing those pages with the Back button. (This ought to work in everything after Netscape 2.x, including all of the IEs.)<BR><BR>I /think/ this also works in the ACTION= properties of forms, but I&#039m not sure.<BR><BR>-EDG

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts