Machine-translated by Google. Questions are authored in English.
Top

Discussion

What is the primary purpose of a cookie in web applications ?

  • A.Store large amounts of data
  • B.Execute server-side scripts
  • C.Store small amounts of data on client side
  • D.Encrypt data transmission

Answer: C

A cookie's primary purpose is to store small amounts of data on the client side.

A cookie is a small name-value pair, limited to about 4 KB, that the server sets through the Set-Cookie header and the browser sends back with later requests. Because HTTP is stateless, cookies are used to keep session identifiers, preferences and tracking state.

Large amounts of client data go in localStorage or IndexedDB, not cookies. Cookies do not execute any script. Encryption of data in transit is the job of TLS.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.