What is the purpose of the 'same-origin policy' in web browsers? MCQ with Answer and Explanation

What is the purpose of the 'same-origin policy' in web browsers?
A. To prevent scripts from accessing data from different origins
B. To ensure cookies are only sent to the same site
C. To block pop-ups
D. To enforce HTTPS usage
Answer: Option A
Solution (By JKSSB Mock Tests)
The same-origin policy restricts how documents or scripts loaded from one origin can interact with resources from another origin, protecting against attacks like CSRF and data theft.

Discuss this Question (0)

No comments yet. Be the first to start the discussion!

Practice More Internet and Web Technologies Questions

Question #1
Which parameter indicates a 'URL encoding' or 'Percent-encoding' mechanism's primary purpose?
A. To replace secure HTTPS encryption keys with basic string variables
B. To compress big images inside web files to save network bandwidth
C. To hide domain location routes from search engines
D. To convert non-ASCII or special characters within a URL into a safe format that can be reliably transmitted over HTTP

Correct Answer: Option D


Explanation:
URLs must only contain characters from a specific safe ASCII set. Characters outside this set are converted into a '%' followed by a hexadecimal code sequence (e.g., spaces become %20).

This question belongs to: Computer Internet and Web Technologies
Question #2
What kind of network attack redirects a user from a legitimate website to a fraudulent one by altering the local DNS cache or host records?
A. Pharming
B. DDoS
C. Spamming
D. Phishing

Correct Answer: Option A


Explanation:
Pharming is a cyberattack intended to redirect a website's traffic to another fake site by spoofing DNS records or host configuration settings.

This question belongs to: Computer Internet and Web Technologies
Question #3
Which of the following browser utilities allows software developers to directly inspect a webpage's DOM structure, debug JavaScript errors, and trace network resource load timelines natively?
A. Incognito Browser Window
B. Bookmark Navigation Hub
C. Browser Cache Manager
D. Developer Tools (DevTools)

Correct Answer: Option D


Explanation:
Built-in Developer Tools (DevTools) in modern browsers provide deep access to inspect elements, analyze network payloads, check console logs, and debug scripts.

This question belongs to: Computer Internet and Web Technologies