Joke Collection Website - News headlines - What are the cookies left on the Internet?
What are the cookies left on the Internet?
Editor's note: Cookie means small dessert in English, and we can always see this word in the browser. How can food be related to the browser? When you browse a website you have logged in before, you may see the following message on the web page: Hello XX, it feels very friendly, just like eating a small dessert. This is actually achieved by accessing a file in your host, so this file is also called a cookie. Want to know all about cookies? Take a look below! 1. Understand Cookie Applicable objects: Junior readers Cookie is a small text file that the website stores on your machine when you browse a website. It records your user ID, password, web pages browsed, time spent on it, etc. , when you come to the website again, the website learns your relevant information by reading the cookie, and can take corresponding actions, such as displaying a slogan welcoming you on the page, or allowing you to browse directly without entering your ID or password. Log in and more. You can view all cookies saved to your computer by selecting "Settings/View Files" in the "General" tab of "Tools/Internet Options" in IE. These files are usually named in the format user@domain, where user is your local username and domain is the domain name of the website you are visiting. If you use the NetsCape browser, it is stored in "C:\PROGRAMFILES\NETSCAPE\USERS\". Different from IE, NETSCAPE uses a Cookie file to record the cookies of all websites. In order to ensure Internet security we need to set cookies appropriately. Open the "Privacy" tab in "Tools/Internet Options" (note that this setting only exists in IE6.0, other versions of IE can click "Custom Level" in the "Security" tab of "Tools/Internet Options" button to make simple adjustments) to adjust the security level of cookies. Normally, you can adjust the slider to the "medium-high" or "high" position. Most forum sites require the use of cookie information. If you never go to these places, you can adjust the security level to "Block All Cookies". If you just want to block cookies from individual websites, you can click the "Edit" button to add the websites you want to block to the list. In the "Advanced" button option, you can set first-party cookies and third-party cookies. First-party cookies are cookies from the website you are browsing, and third-party cookies are not cookies sent to you by the website you are browsing. Usually you have to choose "Reject" for third-party cookies, as shown in Figure 1. If you need to save cookies, you can use IE's "Import and Export" function, open "File/Import and Export", and follow the prompts. Most of the content in the cookie is encrypted, so it seems to us that it is just a meaningless combination of letters and numbers. Only the server's CGI handler knows their true meaning. We can view more content through some software. The cookie information viewed using Cookie Pal software is shown in Figure 2. It provides us with the contents of Server, Expires, Name, Value and other options. Among them, Server is the website that stores cookies, Expires records the time and lifetime of the cookie, and the Name and value fields are specific data (this newspaper has a detailed introduction to this software in Issue 10, Page 42). Download address:/down/200411/cfnetwork/cp1.exe. 2. Cookie delivery process Applicable objects: Intermediate readers When typing the URL of a Web site in the browser address bar, the browser will send a request to read the web page to the Web site and display the result on the monitor. At this time, the webpage looks for the Cookie file set by the Amazon website on your computer. If it is found, the browser will send the data in the Cookie file together with the previously entered URL to the Amazon server.
When the server receives the cookie data, it will retrieve your ID, your shopping records, personal preferences and other information in its database, record the new content, and add it to the database and cookie files. If no cookie is detected or your cookie information does not match the information in the database, it means that you are browsing the website for the first time, and the server's CGI program will create new ID information for you and save it in the database. Cookies are transferred using the HTTP header information in the web page code. Cookies can be transferred with every web page request made by the browser, for example, when the browser opens or refreshes the web page. The server adds the cookie to the HTTP header information of the web page, and transmits the web page data back to your browser. The browser will choose whether to save this data based on the cookie settings on your computer. If the browser does not allow cookies to be saved, the data will disappear after closing the browser. The time that cookies are stored on your computer is different, which is determined by the server settings. Cookies have an Expires (validity period) attribute, which determines the cookie storage time. The server can change the cookie storage time by setting the value of the Expires field. If this attribute is not set, the cookies are only valid while browsing the web. If you close the browser, these cookies will disappear automatically. This is the case for most websites. Normally, a cookie contains the fields Server, Expires, Name, and Value. Only the Name and Value fields are useful to the server. The contents of the Expires and other fields are just to tell the browser how to process these Cookies. 3. Cookie Programming Implementation Applicable objects: Advanced readers Most web programming languages ??provide support for Cookies. Such as JavaScript, VBScript, Delphi, ASP, SQL, PHP, C#, etc. In these object-oriented programming languages, the programming utilization of Cookie is basically similar. The general process is: first create a Cookie object (Object), and then use the control function to assign, read, write and other operations to the Cookie. So how to obtain sensitive information in other users' cookies through code? A brief introduction follows. This method has two main steps. First, locate the website where you need to collect cookies, analyze it, and construct the URL; then compile the PHP code to collect cookies and put it on a website that you can control, without knowing it. The PHP code can be executed after the user clicks the URL you constructed. Let’s look at the specific implementation process below. 1. Analyze and construct the URL. First open the website where we want to collect cookies. The assumption here is that when logging into the website, enter the user name "