Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the functions of cookie

2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces the functions of cookie, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

Cookie functions: 1, Cookie is saved in the client plain text file; 2, Cookie files must be supported by the browser, in the browser can be set to block cookie.

Functions of cookie:

Cookie is a plain text file saved on the client side. Such as txt files. The so-called client is our own local computer. When we use our own computer to access the web page through a browser, the server generates a certificate and returns it to my browser and writes it to our local computer. This certificate is cookie. Generally speaking, cookie is a plain text file written to the client on the server side. Let's take a look at the cookie file written to us by the general website as follows:

Cookie files must be supported by the browser, where blocking cookie can be set. In this way, the server cannot write cookie to the client. Currently, most browsers support cookie. Such as Google, IE, Firefox and so on. Generally speaking, cookie cannot be blocked, because sometimes you have to use cookie when you visit a website. Otherwise, the website will not be accessible.

So, here comes the problem: what exactly are we going to do with this thing?

For example, when we go shopping on the website and I open the shoe shopping page, I send a request and tell the server that you return some information and list of shoes to me, and then the connection between the client and the server is disconnected.

The user visits again, adds a pair of shoes to the shopping cart and then disconnects. At this time, the user wants to buy a pair of pants, the user adds the pants to the shopping cart, and the connection is disconnected. At this point, the user asked again, "I'm going to check out, and then the user opens a new checkout interface. Now the question is, how does the server of the shopping cart that the user has just joined know?" How does the server know that this user bought it?

So now we use cookie. Before the emergence of seesion, general websites saved the requested content through cookie, and the server displayed the specific content according to the user. In other words, if we don't use cookie, we won't be able to see the shopping cart in the browser, which is similar to the browser's favorites. If we do, the next time we open the browser window, we will see our collection. In other words, cookie saves a state before and after, and I don't know if I have joined the shopping cart without cookie. Then why did this happen? In the final analysis, it is because of the lack of connectivity of http.

Thank you for reading this article carefully. I hope the article "what are the functions of cookie" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report