LocalStorage sometimes has problems, not as good as cookie insurance and compatibility, because it exists for a long time, and localStorage is after H5;

An explanation of whether secondary domain names can get cookies

Link – – > javascript. The info/cookie

You can use the existing good library, JS cookie github.com/js-cookie/j…

The library is explained as follows

If the default js cookie is not set to domain, it means that the secondary domain name cannot be shared (IE is an exception, of course, can be shared).

So if we want secondary sharing we need to set it up like this

Cookie. set(‘name’, ‘value’, {domain: ‘site.com’}) can also cookie. set(‘name’, ‘value’, {domain: ‘.site.com’}) this is the new standard.