3 ms·
The biggest advantage of localStorage is that it is, as its name implies, "local" to the site you are visiting. Cookies can be shared accross domains and sites
by XCSme 6y ago
The biggest advantage of localStorage is that it is, as its name implies, "local" to the site you are visiting. Cookies can be shared accross domains and sites you visit, but localStorage can not. If one on domain you store `localStorage.ID = 5`, you can not read that from another domain, as `localStorage.ID` will be undefined in a different domain context.