So I'm trying to make a cross-domain AJAX request with javascript.
My OPTIONS request is executing without any problems, and I'm getting back
Access-Control-Allow-Origin:*
as a response header. However, when trying to make the subsequent POST request, I get the following error:
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://phoenix-client.local' is therefore not allowed access.
I've verified multiple times that my OPTIONS request is indeed sending the correct response, including the Access-Control-Allow-Origin header, but the browser seems to ignore it :(
Any ideas?
edit - A couple things I've been noticing:
If I try to update the headers my server is sending, everyone else except me gets the newly updated headers when they make a request. It's as if my computer is caching the responses to OPTIONS requests.
This is only occurring for one of my AJAX requests. I make multiple requests before the request that fails, and all of them work fine (with the headers as is) except for the last one.
EDIT!!!!
Updating this post (extremely late). This ended up not being a CORS error. I get a false "Access-Control-Allow-Origin" error from Chrome, but when I run the AJAX request directly, I get the real error (which typically is supposed to be an error 500, with some sort of PHP error messaging). Still unsure why this is occurring though...