Which storage API stores data per tab or per browser session and is cleared when the tab or browser is closed?

Prepare for the uCertify CIW Advanced HTML5 and CSS3 Specialist Exam. Dive into essential topics with flashcards and multiple-choice questions. Enhance your understanding with hints and explanations for each question. Pass your exam confidently!

Multiple Choice

Which storage API stores data per tab or per browser session and is cleared when the tab or browser is closed?

Explanation:
The concept being tested is how browsers store ephemeral data tied to a single browsing session. Session storage is designed for data you only need while the tab is open. Each tab gets its own sessionStorage, and the data remains available as long as that tab is open. If you close the tab (or the browser), the data is cleared. Reloading the page in the same tab keeps the data, but it won’t carry over to other tabs. This is why sessionStorage is the best fit for the description. LocalStorage, in contrast, persists across tabs and sessions, so it isn’t cleared when a tab closes. AppCache (an older, deprecated offline caching feature) isn’t about per-tab data. The Geolocation API is for obtaining location data, not storing it.

The concept being tested is how browsers store ephemeral data tied to a single browsing session. Session storage is designed for data you only need while the tab is open. Each tab gets its own sessionStorage, and the data remains available as long as that tab is open. If you close the tab (or the browser), the data is cleared. Reloading the page in the same tab keeps the data, but it won’t carry over to other tabs.

This is why sessionStorage is the best fit for the description. LocalStorage, in contrast, persists across tabs and sessions, so it isn’t cleared when a tab closes. AppCache (an older, deprecated offline caching feature) isn’t about per-tab data. The Geolocation API is for obtaining location data, not storing it.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy