SUMMARY
Web Storage defines two objects to save data: sessionStorage
and localStorage
. The former is used strictly to save data within a browser session because the data is removed once the browser is closed. The latter is used to persist data across sessions.
IndexedDB is a structured data storage mechanism similar to an SQL database. Instead of storing data in tables, data is stored in object stores. Object stores are created by defining a key and then adding data. Cursors are used to query object stores for particular pieces of data, and indexes may be created for faster lookups on particular properties.
With all of these options available, it's possible to store a significant amount of data on the client machine using JavaScript. You should use care not to store sensitive information because the data cache isn't encrypted.