Interpreting Cookie,localstorage,sessionstorage usage and differences

Source: Internet
Author: User
Tags sessionstorage

Cookies Cookie Concept

A cookie is a variable stored on a visitor's computer. This cookie is sent whenever a page is requested by the same computer through a browser. You can use JavaScript to create and retrieve the value of a cookie.

Why make a cookie?

Because HTTP is a stateless protocol, the server does not know the identity of the client from the network connection. What do we do? give the client a pass, one per person, who must bring their own pass for whoever accesses it. This allows the server to confirm the identity of the client from the pass. That's how cookies work .

I understand.

A cookie is a small piece of text, and if the server-side page needs to record the user's information status, use response to issue a cookie to the client browser (the server extracts the information through code, The generated cookie is then saved to the user's browser folder) with a cookie corresponding to the URL to save. When the browser requests the site again, the browser submits the requested URL along with the cookie to the server. The server checks the cookie to identify the user state to extract the user information. The server can also modify the contents of the cookie as needed.

Have a friend who wants to know where to go C:\Users\Administrator\AppData\Roaming not complete

Below is a follow-up address for different browsers

Ie:c:\users\administrator\appdata\roaming\microsoft\windows\templates

Firefox:c:/documents and settings/your user name/application data/mozilla/firefox/profiles There is a random directory like this in this directory B8ypabix.default. B8ypabix.default found similar to cookies.sqlite, such as such a file is a cookie file, but the general editor is not normal to see the content inside.

Chrome:c:\users\administrator\appdata\local\google\chrome\user Data\default;

Interpreting Cookie,localstorage,sessionstorage usage and differences

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.