How Does DaisyUI Keep Theme Data Without Cookies?

0
12
Asked By CuriousCoder92 On

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

Answered By DevGuru42 On

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.

Answered By TechEnthusiast77 On

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.

WebDevDude -

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.

ScriptSurfer -

I thought LocalStorage still had to deal with cookie keys. It’s interesting to know that it’s managed separately.

Answered By CodeWizard99 On

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.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.