views:

47

answers:

1

Hi folks,

I have a page in an eCom process that works like this: if you want an extra membership card click here.

You get the same page and a PHP $_SESSION var is set to recognize your choice, the database is updated with this info, and a hidden amount field is set for the post to the payment gateway.

If you go back in FF or Chrome etc the session var makes sure that the extra card stays in your order and the adjusted price is in the hidden field. However IE is only too happy to serve up the cached copy of the page with the old price and let you head off to the payment gateway as if you never added the card.

I use cache control headers per Microsoft's own recommendation to prevent this behavior in their faulty product:

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

Currently I am thinking that I will have to have this form post to my own script to re-calculate the price and use cURL to send the post to the gateway.

Is that my best choice here?

Thanks for any advice.

JG

+1  A: 

You shouldn't be trusting the user's browser in any case. Send the price information yourself rather than relying on the user to do it for you. Your description of a possible solution sounds about right.

Jeremy Stein