• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Disabling forward button in browser

 
Gopal Shah
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am displaying a html page using servlet. I want to disable the forward button in the browser.

I think it is something to do with HTTP header. But didn't feel comfortable going thru ietf and understanding the protocol.

Thanks & Regards,
Gopal
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65122
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is nothing you can set in the header to disable the browser buttons.
 
Gopal Shah
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Will invalidating the session work ?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34851
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gopal,
You can't disable the browsers forward button. You can stop further requests from being processed on the server side. That can be done through session invalidation or tokens.

If you are taking this approach make sure to set the http headers so the page can't be cached. Otherwise, someone could use the forward button and see a cached page.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can have JavaScript (on the browser side) open a new browser window that does not have back and forward buttons, and fill it from your servlet. There is no way to do this with HTTP headers, it has to be code on the client side.

You see this all the time on commercial sites.

Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic