Understanding Same-Origin Policy
Same-origin policy is fundamental to web security. An origin is defined by scheme (http/https), host, and port. Scripts from one origin cannot read data from another origin. CORS provides controlled exceptions to this policy.
Examples
- JavaScript on example.com cannot read responses from api.other.com
- Cookies are only sent to their origin domain
- localStorage is isolated per origin
Worried about Same-Origin Policy in your app?
Our security audits identify vulnerabilities like this before attackers do. Get expert manual review of your codebase.