0

Below code is used, to navigate back after viewing a report.

<A HREF="javascript:history.back()" >

We have this function in two web where one is using http, another is https connection.

For http, it works perfectly in IE, Chrome, and Firefox.

For https, it wont works for IE. It keep giving Webpage has expired error.

Most likely cause: •The local copy of this webpage is out of date, and the website requires that you download it again.

Can anyone suggest a workaround for this? What is causing this behavior?

noobie
  • 452
  • 4
  • 6
  • 22

1 Answers1

0

There are a few different options you could try depending on your local environment and constraints.

Ideally you should follow a POST/Redirect/GET design pattern to help prevent expired or duplicate form re-submissions.

I have not tried this, but as mentioned in this SO answer in a PHP environment you could try adding:

ini_set('session.cache_limiter','public');
session_cache_limiter(false);

Either in your php files or update it server wide through the php.ini

Another answer could be to change the form to submit via GET instead of POST, but this again will depend on the type and amount of data the form is capturing.

Without knowing more about the environment, the form itself and the purpose it is hard to provide what might be the best solution. It might also be worth considering a redirect and storing the data somewhere temporarily with a random identifier so that the back button goes to something like https://example.com/myform?formdata=[randomidentifier] so that when the user goes back they are not going to the expired POST request but to the redirected page that could extract the data and re-display the form or perform the necessary functionality (but again if you are collecting PII or payment details etc you don't want to expose that to the web, even temporarily)

Community
  • 1
  • 1
Jake
  • 1,207
  • 2
  • 28
  • 46
  • Thanks for the suggestion, will test it out. Does this error come out due to in secure connection, the information wont be stored by cache? – noobie Oct 20 '16 at 07:22