Server storage: database: storage project core data session technology: storage of current user information
Client storage: Cookie storage: The size is limited to 4kb. Upon request, the server returns a cookieID stored in the browser cache, which occupies broadband. The browser general IE6 limits 20 cookies per domain name. UserData is a special feature of IE 59. There are fewer people, and the most used flash local storage is 25 times the space of cookies. Google Gears is eliminated : There is no limit to the storage size, but additional plug-ins need to be installed. IndexedDB technology: The client directly stores objects. Currently It is not the standard of HTML, and there is no limit to the size of HTML5 Webstroage technology: simple to use, the size cannot exceed 8mb
Web session: The client browser starts from connecting to a certain web server, a series of response processes, until the client closes the browser, the session ends
The storage method required in the Web project: storage in the form of key-value, KV pair, key-value pair
sessionStroage session-level storage data storage will only disappear in the current session, close the browser and the data disappears SessionStroage.length View the number of currently stored data SessionStroage ['key'] = 'value' Store a data var a = SessionStroage ['key' ] Read a piece of data SessionStroage.getItem ('key') Read a piece of data SessionStroage.setItem ('key', 'value') Store a piece of data SessionStroage.removeItem ('key') Delete the specified data SessionStroage.clear () Delete all data
localStorage Cross-session storage browser close data still exists localStorage.length View the number of currently stored data localStorage ['key'] = 'value' Store a data var a = localStorage ['key'] Read a data localStorage. getItem ('key') read a data localStorage.setItem ('key', 'value') store a data localStorage.removeItem ('key') delete the specified data localStorage.clear () delete all data