Which of the following is a method to secure cookies against cross-site scripting attacks? MCQ with Answer and Explanation

Which of the following is a method to secure cookies against cross-site scripting attacks?
A. Secure flag
B. HttpOnly flag
C. SameSite flag
D. All of the above
Answer: Option D
Solution (By JKSSB Mock Tests)
HttpOnly prevents client-side script access, Secure ensures transmission over HTTPS, and SameSite restricts cross-site requests, all enhancing cookie security.

Discuss this Question (0)

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

Practice More Internet and Web Technologies Questions

Question #1
Which of the following files contains structured, plain text settings used by the Apache web server to configure localized directory permissions and redirect behaviors?
A. index.php
B. robots.txt
C. sitemap.xml
D. .htaccess

Correct Answer: Option D


Explanation:
The .htaccess (hypertext access) file is a directory-level configuration file supported by several web servers to manage access controls and URL rewrites.

This question belongs to: Computer Internet and Web Technologies
Question #2
Which of the following is a mechanism for websites to request permission to access user's location, camera, etc.?
A. Web API (Permissions API)
B. HTTP headers
C. Cookies
D. URL parameters

Correct Answer: Option A


Explanation:
The Permissions API allows websites to request permissions for sensitive features like geolocation, camera, microphone, etc.

This question belongs to: Computer Internet and Web Technologies
Question #3
Which of the following extensions in a URL represents a top-level domain (TLD) reserved exclusively for accredited educational institutions?
A. .com
B. .gov
C. .org
D. .edu

Correct Answer: Option D


Explanation:
The '.edu' top-level domain (TLD) is reserved strictly for educational organizations and institutional bodies, primarily in the United States.

This question belongs to: Computer Internet and Web Technologies