Localstorage as one of the APIs for HTML5 local storage of Web Storage features, the main purpose is to keep the data in the client, while the client generally refers to the computer of the Shanghai website design user. On mobile devices, because most browsers support Web Storage features, web browsers on smartphones, such as Android and iOS, can use this feature normally.
Localstorage saved data, in general, is permanently saved, that is, as long as the use of localstorage to save information, data is stored in the user's client. Even if the user restarts after closing the current Web browser, the data is allowed to exist. Knowing that a user or program explicitly makes a deletion, the life cycle of the data ends.
In terms of security, Localstorage is secure within the domain, that is, Localstorage is domain-based. Any page within that domain can access the Localstorage data. However, the problem is that the data between browser vendors ' browsers is independent of each other. That is, if you use Localstorage to store a set of data in Firefox, it will not be readable under the Chrome browser. Similarly, because the localstorage data is stored in the user's device, the data stored on different devices is different for the same application.
Reference:
Http://www.w3school.com.cn/html5/html_5_webstorage.asp
Http://www.cnblogs.com/yexiaochai/p/4509472.html
What Localstorage is and what it does