What is a Cookie in php?

Source: Internet
Author: User
Cookie is a way to maintain information on the customer's browser through the server or script language under the HTTP protocol. Cookie usage is common. many websites that provide personalized services use cookies to differentiate different users and display their corresponding content. For example, the free E-mail website of the Web interface requires cookies. Using cookies can easily complete many complex tasks. # Wiki/422.html "target =" _ blank "> Cookie is a way to maintain information on the customer's browser through the server or script language under the HTTP protocol. Cookie usage is common. many websites that provide personalized services use cookies to differentiate different users and display their corresponding content. For example, the free E-mail website of the Web interface requires cookies. Using cookies can easily complete many complex tasks.

Learn about cookies

First, we will briefly introduce what cookies are and what they can do. Let friends have a clear understanding of cookies and sensory concepts.

1. what is Cookie?

Cookie is a mechanism that stores data on the client browser to track and identify users. Simply put, Cookie is a text file temporarily stored on the user's hard disk by the Web server and subsequently read by the Web browser. When a user accesses the Web site again, the website reads the Cookie file to record the specific information of the user (such as the last visit location, time spent, user name and password ), in this way, you can quickly make a response. For example, you can directly log on to the website without entering the user ID and password.

The command format of the Cookie text file is as follows:

User name @ website address: digital example .txt

For example, if your system disk is C and the operating system is Windows, the Web server automatically generates a response Cookie text file in the preceding command format and stores it in the location specified by the user's hard disk.

Note: in the Cookie folder, each Cookie file is a simple and common text file, rather than a program.

Most of the content in the Cookie file is encrypted. Therefore, it seems that it is only a combination of letters and numbers, and only the CGI processing program on the server knows their positive meaning.

2. Where does a Cookie usually exist?

Cookie is essentially a small piece of data that is stored on your computer's hard disk. But where does it exist? The storage path may be different in different browsers.

The storage path of Cookie files in Chrome is:

C: \ Users \ your username \ AppData \ Local \ Google \ Chrome \ User Data \ Default \ Cookies

The path for storing Cookies in Firefox is:

C: \ Users \ your username \ AppData \ Roaming \ Mozilla \ Firefox \ Profiles \ xxx. default \ cookies. sqlite each person may be slightly different

What is the Cookie in php? For more information, see other related articles in the first PHP community!

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.