You are developing a Web app that uses a shopping cart. When a user completes a purchase, all information is saved on the Web server, but you do not want any information to persist in the user’s Web browser. Which of the following JavaScript methods should you use?
a) localStorage
b) sessionStorage
c) either a or b
d) none of the above
Answer: b
Difficulty: Hard
Section Reference: Understanding and Managing Application States
The sessionStorage method keeps data only for one session, until the browser is closed.