SessionStorage, localStorage, cookies

Source: Internet
Author: User
Tags sessionstorage

1 HTML5 Storage is mainly divided into two types: localStorage and sessionStorage. The two are mainly different in the life cycle. localStorage has a long life cycle, in principle, it will not disappear until the content is cleared through Javascript or the user clears the Cache. sessionStorage is cleared when Browser/Tab is disabled.

 

2 cookies

2.1.Cookie is sent to the Server when each HTTP request is sent. No matter you do not need the information in the Cookie, the execution efficiency and unnecessary network bandwidth will be wasted to some extent.

2.2.the data sent by cookies is not encrypted. Therefore, no important information should be put in cookies unless we use SSL-based technologies.

2.3.Cookies can only be 4 kB at most and cannot store too much data

 

Refer:

Http://www.e800.com.cn/articles/2011/0503/484985.shtml

Http://www.cnblogs.com/yuzhongwusan/archive/2011/12/19/2293347.html

 

SessionStorage, localStorage, cookies

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.