Web Storage
the concept and cookie
Similarly, the difference is that it is designed for larger capacity storage. Cookie
The size is limited, and every time you request a new page Cookie
will be sent in the past, this virtually wasted bandwidth, you cookie
also need to specify the scope, not cross-domain calls.
besides, web Storage
have setitem,getitem,removeitem, Clear
cookie
need front-end developer Package setcookie
,getcookie
.
but cookie
is also not available or missing: cookie
Span style= "font-family: '-apple-system '; color: #333333;" The role is to interact with the server as http
part of the specification exists, and webstorage
just for local "storage" of data
browser support in addition ie
7
actually javascript
local storage solution. A simple code encapsulation can be unified to all browsers that support web Storage
.
localStorage
and the sessionStorage
all have the same method of operation, for example setItem
、getItem
and the removeItem
wait
Love to create a classroom day 38th day-web storage and cookie difference?