What is a Cookie? A tutorial on cookies

Internet tips -> What is a Cookie? A tutorial on cookies

Literally, a 'Cookie' is referred to biscuits. But in computers, a Cookie has a different meaning. Even those who know about it, think that cookies cause damage to the computer. In this article let us learn about cookies and their usage.

What is a Cookie?

Cookie is a text file created by the webserver and stored in our computer. Let us see what is the purpose of this text file.

Generally when a client computer connects to a server they both get introduced and start sharing information. The server will identify the computer and this relationship will continue until the connection gets discontinued.

But the connection between the web server and a client computer is 'stateless'. After serving the information that the web client requested, if the same client sends another request, then the web server will not know that it is the same person. Instead it will treat is as a new person and serve the information. Cookie is used to change this 'statelessness' in the web server.

With the use of cookies, when a web client connects to a web server, the web server will create a cookie file and write some information about the web client and store it in the web client computer itself. When the same web client connects to the web server next time, the web server will see the cookie file in that computer and will know about the client.

Why to use a cookie?

Personally there is no use of storing the cookie in our computer. But it helps the web server a lot. Web servers creates cookies for two main reasons.
  • To identify the visitors

    A server will normally write details like when did the visitor visit the website, which are the pages he viewed, what is his name etc in a cookie. When the same person visits the same website again, the server will display his name and welcome him, and show those webpages related to his previous visit and also show the changes since his last visit to the website. In short, cookies are used to personalize the website for the visitors.
  • To record activities

    Cookie is also used to record the activities between the web client and the web server and used to rectify problems that may occur during the session. For example, imagine that you are filling out a form with many fields. After filling the first page and moving to the second page if the computer hangs and you had to restart the computer. Then if you restart and go back to the same webpage, the webserver will know the details that you already entered from the cookie and hence will just show the second page directly. If there was no cookie then you will have to type from the first page again.

Common Myths about cookies.

  1. Cookies spread viruses. This is a false statement. Cookie is a text file, therefore virus cannot spread through viruses.
  2. Cookies get stored in any folder in the computer. This is also false. Cookies are also stored in a specific folder only. For example in c:\windows\profiles\yourname\cookies folder, Internet Explorer creates one text file for each cookie. Netscape navigator will store all cookies in c:\Program files\netscape\users 50\default\cookies.txt file.
  3. Using cookies, the other files in your computer can be read. This also is false. Websites just read their own cookies and do not read other cookies or other files.
  4. From other cookies webserver will know which websites you visit. This is also false. A website will only open its own cookies. It will not read other cookies.
  5. You can't read a cookie. This is also false. Cookie is just a text file. You can read cookies using any text editor like notepad.

How to read a cookie file?

You can use a software like 'Cookies Cruncher' to read cookies. You can download cookies cruncher from www.rbaworld.com

In Netscape navigator all the cookies are stored in a single file. You can read it using Netscape navigator. Select 'Edit->Preferences' and click on 'Privacy & Security' and select 'Cookies'. Now click on 'Manage Stored Cookies'.

Comments :

0 comments to “What is a Cookie? A tutorial on cookies”