Back to Developer Roadmap

Same Origin Policy

src/data/question-groups/frontend/content/same-origin-policy.md

4.0629 B
Original Source

The same-origin policy is a security feature in browsers designed to prevent a web site from accessing data (like importing a script, or sending a request to an API) from another site.

This policy helps protect users from malicious scripts that try to steal sensitive data from other websites, such as cookies, local storage, or content

A way to overcome this limitation is through CORS (Cross-Origin Resource Sharing). As long as the server specifies which domain it can receive requests from, and the client app sends the right headers, they will be able to interact with each other, even if they’re not in the same domain.