INDEPENDENT PERSPECTIVES. INTELLIGENT FUTURES.FOLLOW @THESITIMES ↗
The Super Intelligence Times.
AI · SUPERINTELLIGENCE · ROBOTICS · TECHNOLOGYTHE WORLD, REIMAGINED.
← Technology deskTechnology / ORIGINAL EXPLAINER

The Same-Origin Policy Keeps Websites Apart

A browser needs boundaries even when several unrelated services share one window.

Classic shot of the ENIAC
Classic shot of the ENIAC. · Illustrative archive photograph. Unidentified U.S. Army photographer / Wikimedia Commons · Public domain. Resized for display; image rights remain with the credited creator.

One browser, many trust relationships

A person may open a bank, a newspaper and an unfamiliar link in the same browser. Those pages should not automatically gain access to one another’s private data. The same-origin policy is a fundamental browser boundary that restricts interactions between resources from different origins. An origin is determined by the scheme, host and port. The policy is more nuanced than a universal ban on cross-site activity: embedding some resources and reading their contents are different operations with different rules. The boundary remains important even when the sites share similar visual design.

A shared building with locked offices

The browser resembles a building that hosts many independent tenants. Sharing the building’s infrastructure does not give one tenant permission to open another’s filing cabinet. This separation is especially important because a page can execute code supplied by its operator. Without meaningful boundaries, visiting one site could become a route into information associated with another. The policy helps preserve separate trust relationships while still allowing the web to connect documents and load resources in carefully defined ways.

Exceptions need design

Applications sometimes legitimately need to share data across origins. Mechanisms such as CORS provide controlled ways to permit particular interactions. Developers should understand which boundary they are changing rather than treating a browser error as an obstacle to disable. An origin is also not the same as a company name or a visual brand. Two services that look related may have different origins, while multiple pages under one origin share important privileges. Architecture should therefore consider where content is hosted, who controls it and what authority that placement grants.

Sources & further reading

MDN: Same-origin policy ↗

AI-assisted editorial explainer. Sources are provided for verification.

Suggest a correction ↗

Continue reading

The Small Switch Behind the Digital World ↗

Why Silicon Became a Computing Material ↗

Why a GPU Is More Than a Graphics Chip ↗

Subscribe to the Times ↗

Explore the Times.