Why was the Same-origin policy originally introduced (before XMLHttpRequest)?

As I understand it, the Same-origin policy (SOP) basically prevents a script in a web page from obtaining or sending information from/to a different domain.

I understand that this is important to prevent a page from grabbing private data … Continue reading Why was the Same-origin policy originally introduced (before XMLHttpRequest)?

How did a malicious website managed to serve me the app that is running on my local apache server?

Today I accidentally miss-typed a popular’s website domain, which led me to a malicious website. I realized immediately but before I had time to close the tab, I was surprised to be presented with the web app that I am runnin… Continue reading How did a malicious website managed to serve me the app that is running on my local apache server?

Why are cookies sent with HTML page’s cross domain requests but not with JS’s XHR?

When we write a HTML page with form tag and an action attribute and a submit button. As soon as we click on submit a request is sent (with cookies) to the URL which was the value of action attribute.

But if we send cross domain request t… Continue reading Why are cookies sent with HTML page’s cross domain requests but not with JS’s XHR?