V
V
Vlad_isLove2019-08-23 10:10:33
JavaScript
Vlad_isLove, 2019-08-23 10:10:33

How to store user site settings?

You need to save JavaScript variables with site design settings. For example, if the user switched the site to night mode and changed the site background to dark, then you need to save these settings after reloading the page. I thought to save JavaScript variables in browser cookies and read and apply this data with JavaScript when loading the page, and if it is not there, then install it. But when saving cookies in the browser, the next time the page is loaded, these cookies fly to the server, which can load it pointlessly. Is there a way to store variables completely locally in the browser without server involvement?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene Wolf, 2019-08-23
@Vlad_isLove

Is there a way to store variables completely locally in the browser without server involvement?
Yes - LocalStorage

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question