Session Handling Using localStorage

3. Summary and References


Summary

          Web storage provides an alternative to cookies with larger storage spaces without sacrificing the loading time of web pages. Security is also improved because user information is stored and processed only within the user’s computer.

          The methods that can be used to use local storage and session storage are listed as follows:

      • localStorage.setItem(key, value)
      • localStorage.getItem(key)
      • localStorage.clear()
      • localStorage.removeItem()
      • sessionStorage.setItem(key, value)
      • sessionStorage.getItem(key)
      • sessionStorage.clear()
      • sessionStorage.removeItem()

References

Chikwekwe, F. (2018, November 13). Cookies vs. LocalStorage: What’s the difference? Medium. https://medium.com/swlh/cookies-vs-localstorage-whats-the-difference-d99f0eb09b44

HTML Web Storage API. (n.d.). W3Schools Online Web Tutorials. https://www.w3schools.com/html/html5_webstorage.asp

JSON.parse(). (n.d.). W3Schools Online Web Tutorials. https://www.w3schools.com/js/js_json_parse.asp

JSON.stringify(). (n.d.). W3Schools Online Web Tutorials. https://www.w3schools.com/js/js_json_stringify.asp

Storage. (2021, February 19). MDN Web Docs. https://developer.mozilla.org/en-US/docs/Web/API/Storage

Storage Object. (n.d.). W3Schools Online Web Tutorials. https://www.w3schools.com/jsref/api_storage.asp

Window.localStorage. (2020, Septemeber 2). MDN Web Docs. https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage 

Window.sessionStorage. (2021, March 31). MDN Web Docs. https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage