Why does Access-Control-Allow-Origin: * fail with cookies or credentials?
The browser Fetch specification strictly forbids wildcard `*` when `Access-Control-Allow-Credentials: true` is set. Echo a validated specific origin and add `Vary: Origin`.
Eliminate browser CORS errors in seconds. Configure allowed origins, methods, headers, credentials, and Vary: Origin with instant Fetch-spec validation.
The browser Fetch specification strictly forbids wildcard `*` when `Access-Control-Allow-Credentials: true` is set. Echo a validated specific origin and add `Vary: Origin`.
Without `Vary: Origin`, CDNs like Cloudflare may cache a response for `https://a.example.com` and serve it to `https://b.example.com`, breaking CORS.
Return HTTP `204 No Content` with all `Access-Control-Allow-*` headers and `Access-Control-Max-Age` to cache the preflight.