Search code examples
javascripthtmlvariablessavereload

Saving a variable for all users viewing the website


I am working on incrementing a variable for a script for my site, but before moving on with that I got a question. if I have a variable which I increment by one whenever a function is called and I then save the variable, either by localstorage or by cookies, is it visible for all users on the website that the variable has been updated whenever they reload the page?


Solution

  • No - cookies and local storage are client-specific.