Joke Collection Website - News headlines - What is the function of Cookie?

What is the function of Cookie?

Function: cookies can be used to track and count users' habits of visiting websites, such as when they visited, which pages they visited and the time they stayed on each page. Using this information, on the one hand, it can provide personalized service for users, on the other hand, it can also be used as a tool to understand all users' behaviors, which has certain reference value for the improvement of website management strategy.

At present, the most widely used Cookies is to record the user's login information, so that you don't need to enter the user name and password for the next visit-of course, this convenience also has the problem of user information leakage, especially when multiple users use a computer.

form

A Cookie is a small piece of text data not exceeding 4KB, which consists of a name, a value and several other optional attributes, and is used to control the validity, security and scope of use of cookies. These include:

(1)Name/Value: set the name of the Cookie and its corresponding value. For authentication cookies, the value value includes the access token provided by the Web server.

(2)Expires attribute: Set the lifetime of Cookie. There are two types of Cookie: conversational and persistent. By default, the Expires property is a session Cookie, which is only stored in the memory of the client and will be invalid when the user closes the browser. The persistent Cookie will be saved in the user's hard disk until the expiration of the lifetime or the user directly clicks the "logout" button in the webpage to end the session.

Above content reference: Baidu Encyclopedia -cookie