We have developed an AngularJS application that interacts with a RESTful web service hosted on a separate domain. Our CORS script works smoothly on Chrome and Firefox, but we are encountering issues with IE9 and Safari during authentication. It appears that the problem lies with the withCredentials attribute in these browsers. Are there any alternative methods for enabling CORS in IE and Safari?
<script type="text/javascript">
XMLHttpRequest.prototype.realSend = XMLHttpRequest.prototype.send;
XMLHttpRequest.prototype.send = function(vData) {
this.withCredentials = true;
this.realSend.apply(this, arguments);
};
</script>