Which of the following statements is/are TRUE ? (a) In HTML, character…
2017
Which of the following statements is/are TRUE ?
(a) In HTML, character entities are used to incorporate external content into a web page, such as images.
(b) Once a web server returns a cookie to a browser, the cookie will be included in all future requests from the browser to the same server.
Code :
Answer: B. Only (b) is TRUE. — Answer: Only (b) is TRUE. Why statement (a) is false: Character entities (for example &, <, >, ') are used to represent reserved or special…
- A.
Only (a) is TRUE.
- B.
Only (b) is TRUE.
- C.
Both (a) and (b) are TRUE.
- D.
Neither (a) nor (b) is TRUE.
Attempted by 102 students.
Show answer & explanation
Correct answer: B
Answer: Only (b) is TRUE.
Why statement (a) is false: Character entities (for example &, <, >, ') are used to represent reserved or special characters in HTML. They are not a mechanism to incorporate external resources. To include external content like images, HTML elements such as the img tag with a src attribute are used.
Why statement (b) is true (with typical conditions):
When a server sets a cookie, the browser stores it and will include it in subsequent HTTP requests to that server if the request URL matches the cookie's domain and path and the cookie has not expired.
Security attributes affect when cookies are sent: the Secure flag restricts sending to HTTPS connections; HttpOnly prevents JavaScript access but does not stop the browser from sending the cookie with requests.
Therefore, generally the browser includes returned cookies in future requests to the same server, subject to domain/path, expiration, and security attributes.