I've got two domains A and B.
A hosts a form A/inquire
that submits a post request to B/form-submission
B accepts a POST request at B/form-submission
and redirects to A/thankyou
One tricky thing here is that A hosts the form from within an <iframe>
so when the user submits the form the iframe bounces to B then back to A.
About 10-20% of users experience an issue where submitting the form results in the iframe not getting redirect to A/thankyou
, but the form data always gets saved so B/form-submission
's script must be finishing.
B/form-submission (PHP):
header('Access-Control-Allow-Origin: *');
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Accept-Encoding");
header('Access-Control-Allow-Methods: GET, POST, PUT');
... process form and insert data into db - works 100% of the time ...
header("Location: A/thankyou");
exit();
Of course, I am unable to reproduce this myself...
Is there a way to improve the reliability of this? It doesn't appear to be related to my form processing because the last thing that happens before the redirect is a database insertion that always goes through.