Introduction to Cookie Objects

Source: Internet
Author: User
Tags command line html page

What is a cookie

The English meaning of a cookie is a snack that is eaten with milk. However, in the Internet, the word "cookie" has a completely different meaning. So what exactly is "cookie"? A "Cookie" is a small amount of information that is sent by a network server to store on a Web browser so that the next time a unique visitor returns to the network server, it can be read back from that browser. This is useful for browsers to remember specific information about the visitor, such as the location of the last visit, the time spent, or user preferences (such as style sheets). A Cookie is a text file stored in a browser directory that is stored in RAM when the browser is running. Cookies can also be stored on your computer's hard drive once you exit from the Web site or network server. Depending on the design, these cookie data will retain the specified time on the hard disk, theoretically exceeding the hard disk's lifespan.

Cookies are part of the HTTP header file. It can be passed between browsers and servers, and the data and their delivery processes are not directly visible to users.

Cookies are generally trusted based on system accounts and domain names; When Windows systems have multiple users, other users are not allowed to use your cookie data, and under normal circumstances a cookie under a Web site will not be read or written by another site. In most cases, cookies are not plaintext and are encrypted and decrypted in some way.

What is the use of cookies?

One of the purposes of a Cookie is to store the user's password and ID on a specific Web site. In addition, it is also used to store preferences for the start page. On a Web site that provides personalized viewing, your Web browser will be asked to use a small amount of space on your computer's hard drive to store these preferences. In this way, each time you log on to the site, your browser will check to see if you have any predefined preferences (cookies) for that unique server. If so, the browser sends this cookie to the server along with your request for the Web page. Microsoft and Netscape use cookies to create a personal start page on their web site. The general uses of cookies include: online ordering systems, personalized Web sites, and site tracking.

Personalized Web site is one of the most useful uses of cookies. For example, when someone comes to a website, but does not want to view any business news. The website allows him to select the item as an option. Since then (or until the cookie is overdue), he will not be able to read business news when visiting a webpage.

How do these cookies work?

The command line in the document's HTML code tells the browser to set a cookie for a name or value. The following is a generic instance that is used to set up a cookie script.

Set-Cookie: name = VALUE;
expires = DATE;
path = PATH;
domain = DOMAIN_NAME;

So what about security? HTTP cookies cannot be used to retrieve personal data from your hard drive, place viruses, get your e-mail address, or steal sensitive information about your identity; However, HTTP cookies are used to keep track of where you are on a particular Web site. It is difficult to track Web sites without using cookies.

All other Internet-related matters, as you would expect, are anonymous. No website knows who your Excellency is unless you disclose it to your website. At the same time, cookies are just a site tracking statistic used to better understand usage patterns and improve the efficiency of site visitors.

If the Web Designer is designed to make the page more interactive with visitors, or if the designer plans to have visitors customize the appearance of the site, use cookies. Also, if you want your site to change its appearance in some cases, cookies provide a quick, easy way to make your HTML page change as needed. The newest server uses cookies to help with the interactivity of the database, thereby improving the overall interactivity of the site.

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.