One, Cookie disadvantages

1, storage size, maximum 4KB 2, HTTP request needs to be sent to the server, increase the request data volume 3, only use document.cookie = '... ', too crude

LocalStorage and sessionStorage

1. HTML5 is designed specifically for storage and can store up to 5M. 2

LocalStorage and sessionStorage

SessionStorage: Data exists only in the current session and is cleared when the browser is closed