Be the first user to complete this post
|Add to List|
sessionStorage vs localStorage vs cookie applications
sessionStorage, localStorage and cookie all are solutions to store data on client side. They can be used for
- session management
- user preference management
- To setup never expiring tokens and many others.
sessionStorage - persists data only for a sessionIf your app redirects to a URL and comes back then its a new session. Hence, you can't use sessionStorage in that case.
localstorage - persists data until cleared explicitly, hence it persists across sessionsIf you want your data to be cleared after sometime but still persist across different sessions, then its difficult to with localStorage.
cookie - persists until the cookie expires irrespective of sessionYou can use it across multiple sessions and you can delete it programmatically.
- A simple requestAnimationFrame example visually explained
- What are reflows and repaints and how to avoid them
- Remove the blank value from a html select option dropdown
- Managing the browser navigation history using HTML 5 pushstate and popstate
- pseudo elements vs pseudo classes
- window.onload vs document.onload
- webview - load html file