CORS Credentials and Cookies Not Sent
Authenticated API requests fail because cookies aren't sent. CORS blocks credentials even after preflight succeeds.
Credentials mode and CORS headers must align for cookies to transmit.
Error Messages You Might See
Common Causes
- Client not sending credentials: 'include' in fetch
- Server not sending Access-Control-Allow-Credentials: true
- Access-Control-Allow-Origin set to * (incompatible with credentials)
- Cookie SameSite=Strict blocking cross-site cookies
How to Fix It
Client: fetch(url, { credentials: 'include' }). Server: response header Access-Control-Allow-Credentials: true. Set Access-Control-Allow-Origin to specific domain, NOT *. Ensure cookies have SameSite=None; Secure for cross-site. Configure Spring CORS with allowedOriginPatterns and allowCredentials=true.
Real developers can help you.
You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.
Get HelpFrequently Asked Questions
How do I send cookies with fetch?
fetch(url, { credentials: 'include' }) - must also set server headers correctly
Can I use Access-Control-Allow-Origin: *?
Not with credentials. Use specific domain or null for local testing