Jump to content

Recommended Posts

I'm currently building a multi-page form for a project and am having some difficulty with the webpage has expired and ie8. Previously i have used  ini_set('session.cache_limiter', 'private'); however the problem with this is that the form pages are then cached by ie8. For example, say data is submited on page 1 of the form, its processed and user redirected (via header("Location:")) to page 2 (both pages are actualy form.php, just with a page var passed inside the form). If the user then clicks on the menu shown on page 2, they are taken back to page 1, however the cached copy of page 1 is shown, without the latest data just inputted by the user. They must ctrl+refresh to view the latest data which is far from user friendly.

 

Is there a recomended method to avoid "webpage has expired" warnings and prevent caching of such forms at the same time?

 

Any help would be much appreciated :)

 

Cheers :)

Link to comment
https://forums.phpfreaks.com/topic/167637-wepage-has-expired-best-practice/
Share on other sites

Just generate the form again and output the values directly into the form elements instead of relying on the browser history.

 

Thanks, Unfortunately that's what im currently doing and indeed is the start of the problem. I'm not sure i explained it fully in my first post, but take the following example...

 

form page 1 is shown, and user enters their data, however one of the data items they entered is invalid so we show an error message and display the form again inline, allowing them to correct their error.

 

The problem occurs if the user navigates away from this inline error/form page via the nav menu, and then clicks back in their browser, they get the webpage has expired message.

 

Any suggestions? :)

Well, that's the users own fault for leaving the page. It's then up to the browser to decide the best course of action should the user use their browsing history to go back again. Two browsers may handle it differently, and as far as I know there is no standard determining what to do in that case.

Well, that's the users own fault for leaving the page. It's then up to the browser to decide the best course of action should the user use their browsing history to go back again. Two browsers may handle it differently, and as far as I know there is no standard determining what to do in that case.

 

Ok thanks, i thought thay may be the case. I should also mention i'm using client side scripting to validate the form before POSTing so it should eliminate the majority of server side inline error reporting. Was just curious if there was a better way to handle those with js disabled and hence server side validation only :)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.