At times you may come across the need to store some data in the browser so that when the user returns, you already have that data available. This can help solve a problem that might require the connecting and passing data to a server. But I have also found situations where even though I am passing data to a server it is helpful to store some data in the browser to ease the experience for the user.
I’ve recently published two tutorials on ways to store data in the browser. One uses localStorage and the other uses indexedDB.
LocalStorage is a pretty simple solution, but it does have some limitations such as the data can only be a string and there is a limit to how much data you can store. IndexedDB overcomes those limitations, but it is not quite as simple to use as localStorage.
Watch these two tutorial to dive deep into storing data in a browser.