Hey everyone! I'm playing around with daisyUI and noticed that the theme generator can remember my custom themes even after I close the page, but there's no use of cookies at all. If you check out their theme generator, you can create and modify themes and when you come back, everything is just as you left it, despite clearing cookies. However, when I open the site in incognito mode, it starts fresh. How is this possible? What methods are being used to track data without using cookies, and if I want to reset anything that's tracked per user, how would I go about it? Thanks!
3 Answers
You’ve found it! LocalStorage is the way to go here. It's, however, important to remember that in the EU, users need to be given the option to opt out of this type of storage, as it still falls under data storage regulations.
It’s likely using LocalStorage! It’s a web storage solution that lets sites store data right in the browser. Unlike cookies, it doesn’t send data with every request, so it’s pretty efficient.
I thought LocalStorage still had to deal with cookie keys. It’s interesting to know that it’s managed separately.
There are various methods to store data without relying on cookies. LocalStorage is a common one, just like you mentioned. Also, data can be stored server-side linked to a user’s account, which can give a more personalized experience across devices without worrying about cookies. However, this method requires user login, which can limit the audience.
Yeah, you can definitely check LocalStorage in your browser's developer tools! Just inspect the storage tab and you'll see the keys and values there.