cookie, seesion, storage, indexDB
http do not have state
1.Cookie 4k, could set expires and max-time
usage: http header || document.cookie
maintain user page’s state
(Store user’s info in browser but too small, not secure)
2.Localstorage 5m, long time
usage: window
Store user’s info in browser, ex…username
Required same domain port protocol
3.Sessionstorage, short time
Store temporary info in browser
Required same window.
4.indexDB 250m
usage: window
Store huge info in browser, non-relational DB
reference
https://www.cnblogs.com/fundebug/p/about-browser-storage.html