Other Benefits of Using CORS

The table below describes some of the advantages CORS provides to customers who use the ID service.

BenefitDescription
Increased Security

CORS uses XMLHttpRequest to request and transfer data. This method is more secure than a JSONP request. It ensures that there is no way to execute arbitrary JavaScript, which might be contained in the response from the DCS. The CORS XMLHttpRequest response payload is parsed by the ID service JavaScript and not simply executed in a callback function.

Note: To accept cookies, the XMLHttpRequest object needs its withCredentials property set to true. This property is supported in Chrome, Firefox, Internet Explorer (v10+), Opera, and Safari.

Performance Improvements

CORS helps improve performance because:

  • The browser manages resource requests. The request process is transparent to the ID service.
  • Unlike asynchronous JSONP requests, the browser does not de-prioritize and queue CORS requests.
  • The ID service responds permissively. This means when a URL passed in as Origin, the ID service grants the page access to the required resources.

Experience Cloud Services


Connect with Experience League at Summit!

Get front-row access to top sessions, hands-on activities, and networking—wherever you are!

Learn more