Source: sebastiandedeyne.com

Local or session storage?
https://sebastiandedeyne.com/local-or-session-storage/ https://sebastiandedeyne.com/tags/javascript/https://sebastiandedeyne.com/local-or-session-storage/Local storage tends to be the obvious place to persist data locally in a web application. We tend to grab straight for localStorage, but it’s not the only tool in our workbox.

localStorage and sessionStorage are part of the https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API have the same key/value mechanism.

When dealing with storage, try/catch is advices to avoid storage limits and other caveats.

There are more ways to store data locally like https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies, https://developer.mozilla.org/en-US/docs/Web/API/History/state, or https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners