WP Insert Post is a very simple and easy to use function. Currently I have it set up on event triggered by whether a user is logged in during a booking to ratify their booking in its own page. My concern is that if the user were to refresh or go back and submit again the page they would end up with 2 bookings.
So I am looking to prevent that from happening. One idea that I have is to use a session that is created when the page with the new booking is created. That session then populates the field ID => in the insert post array. That way overiding the information in the existing post. For this to work it would rely on the default value of ID being a wordpress creation if the session had no value, ie. a booking had not been made yet.
Would that work and if not does anyone know of a way it might.