The correct way to solve the IE Back button issue?

I have a page in the eCom process that works like this: if you would like to get an additional membership card, click here.

You get the same page and PHP $_SESSION

var is set to recognize your choice, the database is updated with this information, and a hidden amount field is set for the mail message to the payment gateway.

If you go back to FF or Chrome, etc., the var session ensures that the extra card stays in your order and the adjusted price is in a hidden field. However, IE is too happy to serve up a cached copy of the old price page and let you head to the payment gateway like you've never added a card.

I am using cache management headers as recommended by Microsoft to prevent this behavior on their faulty product:

<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">

      

Currently I think I will need to submit this form post to my own script to recalculate the price and use cURL to send the message to the gateway.

Is this my top pick here?

Thanks for any advice.

+2


source to share


1 answer


In any case, you shouldn't trust the user's browser. Submit the pricing information yourself, rather than relying on the user to do it for you. Your description of a possible solution seems correct.



+1


source







All Articles