I have a common authentication form across multiple subdomains (example.com, blog.example.com, and app.example.com). The login form must submit this data to example.com irrespective of where it is shown, so I thought of using CORS, but this:
header("Access-Control-Allow-Origin: http://example.com http://blog.example.com http://app.example.com")
does not work
So I thought of doing the next thing, and checking the Origin header manually on server side, and allowing a Access-Control-Allow-Origin: *
so that requests might be made, but unfortunately, this crops up in the MDN
Important note: when responding to a credentialed request, server must specify a domain, and cannot use wild carding.
Is there any way to make my request work across multiple domains, and still send credentials using CORS ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…