What is the distinction between cookie,sessionstorage,localstorage and the three?

Source: Internet
Author: User
Tags sessionstorage

Sessionstorage, Localstorage is provided by the Web Storage API provided by HTML5 to avoid unnecessary data transfer between browsers and servers.

Sessionstorage, Localstorage, and cookies are data stored on the browser side.

the difference between the three:

Cookies:

1. Limited storage of each domain name (typically 4k)

2. Limited storage of all domain names

3. Will follow the request to be sent to the server

4. There is a limit to the number of different browsers, a domain name under the number of cookies is limited, and the number of restrictions may not be the same

Sessionstorage:

1. When the browser window is closed, the sessionstorage will be destroyed .

2. Large storage capacity (generally larger than localstorage storage capacity)

Localstorage:

1. Permanently save on client

2. The storage capacity of a single domain name is large (typically 5M)

3. Unlimited number of total

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.