web storage

Estimated reading time: 1 minute

web storage

web storage is data store locally in web browser.

  • local storage = data with no expiration date that will persist after the browser window is closed.
  • session storage = data that gets cleared after the browser window is closed

5 type

  • localStorage
  • sessionstorage
  • IndexedDB
  • webSql
  • cookies

step

  • setItem('key','value')
  • getItem('key')
  • deleteItem('key')
  • clear()

package

js

resources

  • https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage
  • https://www.taniarascia.com/how-to-use-local-storage-with-javascript/
  • https://scotch.io/@PratyushB/local-storage-vs-session-storage-vs-cookie
  • https://alligator.io/js/introduction-localstorage-sessionstorage/
  • https://www.smashingmagazine.com/2010/10/local-storage-and-how-to-use-it/