picknick
picknick

Reputation: 4007

How can I avoid page expired?

In which cases will I get page expired error in IE? (It never seem to appen in FF?)

and:

I am trying to avoid page expired in the following scenario:

page1: use post and output page2.

page2: use post but with enctype=multipart and output page3

page3: use post and output page4.

page4: no form.

When I navigate through each page I can use the back button on every page except on page4. It seem to be impossible to go back to the page after a page with a form with enctype=multipart? I always get page expired on page3 in this scenario. Can someone explain why this is the case and how to allow the user to use the back button through every page regardless of what method (POST/GET) that's being used (if it's even possible)?

I know you could solve it by implementing the PRG pattern but that's not really an option here.

Note that the page with enctype=multipart have to have a input with type=file to trigger this behavior. If I remove all file inputs I can use back and forward without any problem.

Thanks!

Upvotes: 4

Views: 706

Answers (2)

Richard Davies
Richard Davies

Reputation: 438

I ran into this exact same issue today. This appears to be a bug in IE since it works just fine in Firefox and Chrome. Like the OP, using the PRG pattern isn't an option in my case.

The only work around I could come up with was to add target="_blank" to the tag on page 3 which causes page 4 to open in a new browser window/tab (thereby leaving page 3 still open in the original window/tab so that it's still available to the user.) Unfortunately, depending on your specific requirements, this might not be an acceptable solution for all cases.

Upvotes: 0

BalusC
BalusC

Reputation: 1109132

That's not possible. Your best bet is really the PRG. You can store the request based data of interest in session before redirect and remove from session after redirect. To prevent the (very rare) edge case that an user submits 2 of those forms at exactly the same moment, store it in some map or associative array in session along an unique request based key and pass that key along as URL parameter or pathinfo of the redirect URL and then remove the data associated with the key from the session.

Upvotes: 1

Related Questions