What is the 'Same-Origin Policy' and what three attributes define 'same origin'?
- A.The Same-Origin Policy restricts how documents and scripts from one origin can interact with resources from another. Two URLs are same-origin if they share identical: scheme (http/https), host (exact hostname including subdomains), and port (explicit or default). https://app.example.com:443 and https://api.example.com:443 are cross-origin (different host)
- B.Browsers apply the Same-Origin Policy to restrict how cookies and storage from one origin sync with another. Two URLs are same-origin if they share identical: scheme (http/https), registrable domain (example.com), and path (/app). https://app.example.com/a and https://app.example.com/b are cross-origin (different path), while the cookies of the domain are shared by both pages in the same profile
- C.The Same-Origin Policy limits how pages and servers from one network can connect to another. Two URLs are same-origin if they share identical: IP address (resolved A record), port (explicit or default), and TLS certificate (same issuer). https://app.example.com:443 and https://api.example.com:443 are same-origin (same address) when both hosts resolve to the same load balancer