Not sure what to search for on this one, so hoped I could get some pointers from others to what must be a common task.
I have a form which posts back to the same page so that the form can be redisplayed with validation errors if necessary.
Actually, I have multiple forms that are loaded dynamically depending on the current status:
step 1 - asks customer how many of our single item they wish to order
step 2 - asks them for their personal details (name, address etc)
step 3 - asks for customisation to each item ordered
step 4 - summarises the items and presents a Pay Now button
If step 2 is completed valid, then I create an Order in the database with an "initialised" status. When step 3 is completed valid the Order is updated to "customisation complete".
The problem arises when the customer reaches step 3 - they've completed step 2 successfully. If they refresh their browser, the form data will be reposted and a new order will be created. Although my system will only allow the latest order to be processed it does mean that my database could get filled with unwanted duplicate data.
So, other than using a SESSION variable to say "OrderCreated = True" or similar, what solutions do people suggest?