wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes Disabling IE Back Button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Disabling IE Back Button" Watch "Disabling IE Back Button" New topic
Author

Disabling IE Back Button

ShivPrakash Srivastava
Ranch Hand

Joined: Mar 24, 2005
Posts: 88
Hi

I want to resscrict the user going to the previous page using IE back button.It tried following solution but did not work

1.
response.setHeader("Cache-Control","no-cache"); //Forces caches to obtain a new copy of the page from the origin server
response.setHeader("Cache-Control","no-store"); //Directs caches not to store the page under any circumstance
response.setDateHeader("Expires", 0); //Causes the proxy cache to see the page as "stale"
response.setHeader("Pragma","no-cache"); //HTTP 1.0 backward compatibility

2. history.forward()

3. window.<onload>=history.go(1)

Pls help.Thanks in Advance

Regards
Shiv
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

You can't.

The browser's back button is there for users to navigate within and across different web sites. It is not for a developer or designer of any particular site to decide whether or not a user can do this.

You should build your app in such a way that it can gracefully handle back button and refresh button clicks. Those things are out of your control.

Also, please see:
http://faq.javaranch.com/java/UseRealWords .
'pls' is not a word in the English language.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Disabling IE Back Button
 
Similar Threads
Re-login issue after click on browsers back button and press refresh
JavaScript not working in Mozilla
Cache control in IE
Struts back button problem after logging out from an application
Logout problem