Home > Web Front-end > JS Tutorial > body text

What does the same origin policy mean?

hzc
Release: 2020-06-28 13:15:47
Original
2918 people have browsed it

The same-origin policy is a convention. It is the core and most basic security function of the browser. If the same-origin policy is missing, the normal functions of the browser may be affected. It can be said that the Web is built on the basis of the same-origin policy, and the browser is just an implementation of the same-origin policy.

What does the same origin policy mean?

Same-origin policy is a convention. It is the core and most basic security function of the browser. If the same origin is missing, policy, the normal functionality of the browser may be affected. It can be said that the Web is built on the basis of the same-origin policy, and the browser is just an implementation of the same-origin policy.

Same origin policy is a well-known security policy proposed by Netscape.

When two tab pages of a browser open Baidu and Google pages respectively

When the Baidu tab page of the browser executes a script, it will check which page the script belongs to ,

means checking whether it has the same origin. Only scripts with the same origin as Baidu will be executed. [1]

If it is not from the same source, then when requesting data, the browser will report an exception in the console, prompting that access is denied.

The same-origin policy is the behavior of the browser to protect local data from being polluted by data obtained by JavaScript code. Therefore, what is intercepted is the data received from the request sent by the client, that is, the request is sent, and the server It responded, but it couldn't be received by the browser.

Recommended tutorial: "JS Tutorial"

The above is the detailed content of What does the same origin policy mean?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template