Which property of the cookie header indicates when the cookie will expire?

Study for the JavaScript Certification Test. Utilizes flashcards and multiple-choice questions; each question includes hints and explanations. Prepare to ace your exam!

The property of the cookie header that indicates when the cookie will expire is the "expires" attribute. This attribute specifies a date and time after which the cookie will no longer be valid. When a cookie is set with an expiration date, the web browser stores it and will automatically delete it once this date and time have passed, ensuring that the cookie does not persist indefinitely.

The "expires" attribute is crucial for managing session data and ensuring that sensitive information is not kept longer than necessary. If no expiration date is provided, the cookie is considered a session cookie and will be deleted when the browser session ends.

Other options listed, such as "max-age," refer to the duration for which a cookie should be considered valid from the moment it is created. "Valid-until" and "time-to-live" are not standard cookie properties in HTTP specifications, making them incorrect choices in this context. Therefore, "expires" is the proper attribute for defining when a cookie will no longer be active.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy