Detailed introduction to cookies

Introduction to Cookies and their functions

A cookie is a small TXT file that the website server places in the client (Client End, which is your computer) when you browse the web. This file stores some things related to the website you visit. When you visit this website next time, the cookie will remember some status or settings from your last visit, allowing the server to send targeted pages. related content. The information contained in cookies does not have a standard format. The specifications of each website server may be different, but it generally includes: the domain name of the visited website (domain name), the time when the visit started, the visitor's IP address and other client information. , some settings of visitors on this website, etc. For example, if you set information such as how many search results should be displayed on a Google page, even if you do not log in to your Google account, you can save it the next time you visit. This is how you put the relevant information when you visited last time. The effect of adding cookies. If it is an online shopping website, some information such as your shopping cart, storage shelves, and your account name are also recorded. In addition, some websites will use cookies to record your login account and password, so that you will automatically log in next time you open the browser.

Of course, if you open the Cookie's TXT file in the system folder, you will not see this information but only a bunch of messy characters, because for security reasons, the contents of Cookies are generally encrypted, and only the corresponding Only the server can read it. In addition, since cookies are only TXT files, not programs, let alone viruses, they cannot run on their own, will not affect the operating system and any other computer programs, and will not spread through the Internet, so they actually do not pose a threat to Internet security. .

For website analysis, the role of cookies is to help embedded code website analysis tools record information about website visits (Visit) and visitors (Unique Visitor). Without cookies, relevant monitoring cannot be achieved. Software that performs website analysis through server-side logs does not require cookies to perform relevant analysis, so cookies are only effective for embedded code tools. Those tools you are familiar with - Google Analytics, Omniture, HBX, WebTrends (embedded code version), etc., all need to place cookies on the computers of website visitors to achieve monitoring.

Number and expiry of cookies

The number of cookies refers to the number of cookies that a website can place on the client. A website does not only place one cookie on the client, but multiple different cookies as needed. For website analysis tools, the cookies that help monitor Visits and the cookies that help monitor Unique Visitors cannot be one, but should be set separately. For each website (domain), the maximum number of cookies that different browsers can support is different. IE7 and FireFox3.0 support 50 cookies per website, while Opera supports 30. Whether it's 30 or 50, it's basically enough.

Cookie expiration is another very important concept and one of the important attributes of cookies. Any cookie has a validity period. Some cookies are valid for a short time, some cookies automatically expire when the browser is closed, and some are so-called "permanent cookies." In fact, the cookie expiration date is set manually on the server side. It can be set to 1 second, or it can be set to 10 years, or it can also be set to expire when the browser is closed, completely based on the needs of different situations. Permanent cookies refer to cookies that last for a long time, but are not really permanent.

The timeliness of cookies is of great significance to website analysis and monitoring. The monitoring of Visit depends on the validity of Cookie. For example, Google Analytics sets two expirations for Visit's cookies, one for 30 minutes and the other when the browser is closed. This means that if the Visit Cookie is not updated within 30 minutes, the Cookie will become invalid - this is why we say that the Visit metric measures page views that occur no more than 30 minutes apart. If the time exceeds 30 minutes, the Visit count will be increased by 1. In addition, if you open a website, watch it for a while and then close the browser, then when you open the browser again and reopen the website, even if the two visits do not exceed 30 minutes, it will be calculated as a new visit. The reason is that the Visit Cookie browser closes the expiration setting.

Unique Visitor also relies on cookie expiration. If the cookie time is set to expire in 2 days, then if you visit the same website today and tomorrow, the Unique Visitor will only be recorded as increasing from 0 to 1; and if you come again on the third day, the Unique Visitor will increase again. Increase the count once, for a total of 2 times. In addition to Visit and Unique Visitor, metrics such as Return visitor and Frequency also depend on the validity of cookies.

Guess you like

Origin blog.csdn.net/2302_78587828/article/details/132321049