http
, the domain normal-website.com
, and the port number 80
. The following table shows how the same-origin policy will be applied if content at the above URL tries to access other origins:http://normal-website.com/example/
http://normal-website.com/example2/
https://normal-website.com/example/
http://en.normal-website.com/example/
http://www.normal-website.com/example/
http://normal-website.com:8080/example/
HttpOnly
is an additional flag included in a Set-Cookie
HTTP response header. Using the HttpOnly
flag when generating a cookie helps mitigate the risk of client side script (JavaScript) accessing the protected cookie. The example below shows the syntax used within the HTTP response header:HttpOnly
flag is included in the HTTP response header, the cookie cannot be accessed through client side script (again if the browser supports this flag). As a result, even if XSS exists, and a user accidentally accesses a link that exploits this flaw, the browser (primarily Internet Explorer) will not reveal the cookie to a third party.Content-Security-Policy
with a value containing the policy. The policy itself consists of one or more directives, separated by semicolons.