All Exams Test series for 1 year @ ₹349 only
Question

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.

The correct answer is

Neither (a) nor (b) is TRUE.

Analyzing Statements about HTML Character Entities and Web Cookies

The question asks us to evaluate two statements regarding web technologies: HTML character entities and web cookies. Let's analyze each statement carefully.

Statement (a): HTML Character Entities and External Content

Statement (a) says: "In HTML, character entities are used to incorporate external content into a web page, such as images."

  • What are HTML Character Entities? Character entities in HTML are special codes used to display reserved characters (like <, >, &) or characters that are not available on a standard keyboard (like mathematical symbols, currency symbols, or accented letters). They typically start with an ampersand (&) and end with a semicolon (;), for example, &lt; for < or &copy; for ©.
  • How is External Content (like Images) Incorporated? External content, such as images, videos, stylesheets, or scripts, is typically incorporated into an HTML document using specific HTML tags and attributes that reference the external file's URL. For example, images are embedded using the <img> tag with the src attribute specifying the image file's path or URL: <img src="image.jpg" alt="Description">. Other examples include <link> for stylesheets, <script> for JavaScript, and <video> for videos.

Based on this, character entities are used for displaying special characters within the HTML document itself, not for linking or embedding external files like images. Therefore, statement (a) is FALSE.

Statement (b): Web Cookie Persistence and Requests

Statement (b) says: "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."

  • What is a Web Cookie? A web cookie is a small piece of data that a server sends to the user's web browser. The browser stores it and sends it back with the next request to the same server. Cookies are often used to remember stateful information, such as user login status, shopping cart items, or user preferences.
  • How are Cookies Sent Back? When a browser makes subsequent requests to the server that originally set the cookie, it includes the cookie data in the HTTP request header (specifically, the Cookie header). This allows the server to recognize the user or remember their previous state.
  • Are Cookies Sent in ALL Future Requests? While it is true that cookies are sent in subsequent requests to the same server, the statement "all future requests" is not entirely accurate or complete. Cookies have attributes that control their behavior, including:
    • Expiration Date: Cookies can be set to expire after a certain time or when the browser session ends. Once expired, the browser no longer sends the cookie.
    • Domain and Path: Cookies are associated with a specific domain and can be restricted to certain paths within that domain. They are only sent to servers within that domain (or subdomain) and for requests matching the specified path.
    • Deletion: Users can manually delete cookies from their browser, or browser settings might clear them automatically.
    • Security Flags: Attributes like Secure (only send over HTTPS) and HttpOnly (prevents JavaScript access) also affect when and how cookies are used.

Because cookies are subject to expiration, path restrictions, and user deletion, they are not necessarily included in *all* future requests indefinitely, even to the same server. The statement is too absolute. Therefore, statement (b) is FALSE.

Conclusion on HTML and Cookie Statements

Based on our analysis:

  • Statement (a) is FALSE because character entities are for special characters, not for embedding external content like images.
  • Statement (b) is FALSE because cookies have expiration dates and path restrictions and can be deleted, meaning they are not included in absolutely all future requests to the same server indefinitely.

Since neither statement (a) nor statement (b) is true, the correct option is the one stating that neither is true.

Statement Evaluation Reason
(a) HTML character entities for external content like images. FALSE Character entities display special characters; <img> tag embeds images.
(b) Cookies included in all future requests to the same server. FALSE Cookies expire, have path restrictions, and can be deleted.

Therefore, neither statement (a) nor statement (b) is TRUE.

Revision Table: Key Concepts

Concept Description Used For
HTML Character Entities Codes starting with & and ending with ; Displaying reserved characters or characters not easily typed.
<img> Tag HTML element with src attribute Embedding images into a web page.
Web Cookie Small piece of data sent from server to browser Maintaining state, remembering users, storing preferences across requests.
HTTP Request Header (Cookie) Part of the request sent by the browser Transmitting stored cookie data back to the server.

Additional Information: Expanding on Web Technologies

Let's look at some related concepts to further understand HTML and web communication:

  • Other HTML Embedding Methods: Besides <img>, HTML provides tags like <audio>, <video>, <iframe> (for embedding other web pages), and <object> or <embed> for various multimedia or plugin content. Cascading Style Sheets (CSS) are linked using <link> tags, and JavaScript files using <script> tags.
  • Types of Cookies: Cookies can be classified by their lifespan:
    • Session Cookies: These expire when the user closes the browser session.
    • Persistent Cookies: These have an expiration date set in the future and remain on the user's computer until that date or until manually deleted.

    They can also be classified by their origin:

    • First-party Cookies: Set by the domain the user is visiting.
    • Third-party Cookies: Set by a domain other than the one the user is currently visiting (often used for tracking across sites, although increasingly restricted).
  • Cookie Attributes: Key attributes like Expires or Max-Age determine lifespan, Domain and Path define scope, and Secure, HttpOnly, and SameSite add security and control access.

Understanding these details helps clarify the limitations of statement (b).

Was this answer helpful?

Important Questions from HTML

  1. In HTML, month attribute defines a control with ______

  2. Which of the following tag creates a checkbox for a form in HTML?

  3. In a HTML form, which of the following input control is used for allowing users to make multiple selections?

  4. What is the full form of SGML?

  5. Which of the following is NOT a pair tag in HTML?

Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App