This is a secutiry browser question, not an Angular one. When you make a crossdomain AJAX request, if you want to send cookies (mainly authentication data), the browser needs to specify Access-Control-Allow-Credentials with true , indicating that this allows the external domain. The reason for these two headers is that the site may allow AJAX requests from another domain, but they may not want this domain to use any possible authorization cookies in the browser.
As an example of what this risk entails, you can write an application to access the Facebook API through AJAX. But if Facebook allowed you to send cookies that may exist in the browser, you can create publications as if you were an authenticated user, which, of course, cannot be allowed. By preventing existing cookies from being sent, the user must provide your application with their Facebook credentials in order to do something in their name.
In addition to this check, sending cookies via XMLHttp also does not work if the Access-Control-Allow-Origin parameter is set to "*". Domains must be explicitly added to ensure that you do not provide access to potentially dangerous sites.
source share