Javascript Data Storage

Client side storage in storing data in the clients browser using Javascript API's.

Because cookies had limitations... local storage was invented. Unless you want to support old browsers, dont use cookies anymore...

Web Storage Options (simple)

Local storage persists the data and session storage lasts only until the browser is closed.
Both local and session storage use the same api.
Both use key value pairs
Object and Aray storage is now allowed
Data is domain specific

IndexedDB (complex)

For indexed db keep in mind the storage size, especially on mobile.
full database
arrays, objects, and videos
structured data with key
async to allow application operation
Cannot sync with server backend data
no data in private mode
also depends on browser quota limit

Other Options