same-origin policy

The browser security rule that stops page code from reading responses from a different origin unless that origin allows it.

In more detail

It protects your logged-in sessions on one site from scripts on another. CORS is the controlled way to relax it. Command-line clients have no such policy.

Example

In the browser: Without it, any site you visit could read your email or bank pages using your cookies. Sending a cross-origin request is often allowed, but reading the response needs CORS permission from the server.

Related terms

Taught in

References