• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Browser back button

 
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I click back button in internet explorer, my application gives me a blank page.I get the following message:

Warning: Page has Expired
The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you

I am using javascript to set the action of form and then submit the form.

I have kept some information in session object also.

I am unable to debug, why this is happening.

Please help..

Thanks,
Neeraj
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Because...The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you.

More or less because you used javascript to submit the form and now that data is not available when you press the back button.
 
Neeraj Vij
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what can be done to avoid this except avoiding the javascript.

Thanks,
Neeraj.
 
Neeraj Vij
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
at my system..i think this is happening on this site also pls. somebody check and correct me..

Thanks,
Neeraj.
 
Author
Posts: 836
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

More or less because you used javascript to submit the form and now that data is not available when you press the back button.

This would happen if you had no JavaScript in the page... happens to me all the time when I press back!

By pressing back, you are asking the POST request from your form to be re-submitted to the server. As the original message says, IE warns against this for POST methods only (since POST is non-idempotent) to prevent accidental submission of the data twice. If you really want to submit the data again, you can refresh while on the warning page.

Several patterns have been developed to ensure you don't see this, the most common being the Post/Redirect/Get... in essence it uses a GET redirect so the POST request is 'lost' from the browser's history, thus preventing re-submission of the form. For example, see:

http://www.theserverside.com/patterns/thread.tss?thread_id=20936
http://www.theserverside.com/news/thread.tss?thread_id=29758

I think Bear also wrote an article on this pattern a while ago as well, but I can't find a link to it right now...
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Article.
 
I hired a bunch of ninjas. The fridge is empty, but I can't find them to tell them the mission.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic