The important world of client-side storage! 💾
Hi, *|USERNAME|*!
When browsing our favorite sites, there are a lot of under-the-hood technical happenings that we take for granted. Here is one example. If a site requires us to sign-in, we provide our username and password, hit a log-in button, and we don't think much about that again:
Do you know what ensures we don't get prompted to log-in each time we authenticate and start navigating through pages on a particular site? How does the site remember that we authenticated a few pages earlier?
Here is another example. Many sites these days give you the ability to customize parts of their UI. On KIRUPA, you have the ability to customize the visual theme:
You set the theme just once. The site will remember your choice, and all subsequent navigations ensure your theme choice is respected. What makes this work?
Client-Side Storage FTW!
The answer to our authentication and theming questions (and a whole bunch more!) revolves around something known as client-side storage. As part of many web sites working the way they do, they store bits and pieces of data in our local browsers. This data helps the site better recognize you and me and provide a more personalized experience without any fuss or interruption.
When it comes to client-side storage, three popular solutions we can use are:
🍪 cookies
💾 localStorage
👓 sessionStorage
To learn more about what each of these three solutions do, when you would use them, and what sets them apart, check out the awesome Cookies vs. localStorage vs. sessionStorage article written by Dillion Megida.
TILL NEXT TIME!
As always, before I leave you to it, I would love to hear from you on things I can do better, topics you'd like me to write about, and more. Don't be shy! The easiest way to contact me is via Twitter or by posting on the forums (like all the cool kids 10 years ago)!
Cheers,
Kirupa 😃