Raul Cano logo

Same Origin Policy (SOP)

First we need to know what origin, it’s basically the schema or structure of the URL.

http://example.com:8080/path?query=1#fragment
// scheme: http
// host: example.com
// port: 8080
// path: /path
// query: ?query=1
// fragment: #fragment

Let’s say our URL is http://store.company.com/dir/page.html

The following table gives examples of origin comparisons with the URL