Answer the question
In order to leave comments, you need to log in
Why does CORS Ajax POST request fail every other time on iOS7?
So, I ran into a problem, only in iOS7 , when a CORS Ajax POST request is made to the server, every 2nd or 3rd request does not pass, it fails. Fail only if the server returns any data, in my case json.
I checked with different headers, it always fails every other time, however, if you put
it there will be no errors, however, json will not be given.
json - the most primitive
Header's that I tried and with which it gives an error every other
time
:
header('Content-Length: 0');
'{"test1":"test1", "test2":"test2"}'
header('Access-Control-Allow-Origin: *');
header('Content-Type: application/json');
header('Content-Length: '. strlen($response));
header("Cache-Control: no-cache, no-store");
header("Expires: Tue, 01 Jan 2000 00:00:00 GMT");
header('Pragma: no-cache');
header('P3P: CP="NID DSP ALL COR"');
header('Access-Control-Allow-Methods:POST, GET, OPTIONS');
header('Access-Control-Allow-Headers:Content-Type, x-xsrf-token, X-Requested-With, Authorization, Content-Length, Cookie');
header('Access-Control-Allow-Origin: *');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question