WebDevelopersNotes logo

home-icon Home / Basics / What are cookies? – Definition

What are cookies? – Definition

Cookies are small files created by some web sites and stored on your computer’s hard disk. It’s the job of the web browser to handle the cookies information it receives from different web sites. In fact, in all modern web browsers, cookies can be managed via the options and settings section and you can even choose to disable this feature altogether.

Please note, not all web sites create cookies. The ones that do, instruct the web browser to store this information on the computer’s hard disk and send it back on the next visit.

Sponsored Links

How do web sites create browser cookies?

Web sites create cookies using programs/scripts that run on the web server (server-side) or the browser program (client-side scripts). These scripts and programs can also specify the expiration date of the cookie which means information in these files doesn’t need to be stored and used for eternity. PHP and Perl are some server-side programming languages that can be used to create cookies; JavaScript is the most popular client-side language.

Cookies will only be stored on your computer if you have the option enabled in the web browser. Thus, you can choose not to accept cookies from any web site by changing the settings – disable browser cookies. Below are snapshots and instructions from the five popular web browsers with which you can enable/disable cookies from web sites.

Internet Explorer

Disable or enable cookies in Internet Explorer browserClick on “Tools” -> “Internet options” -> “Privacy” tab. Move the slider up or down to change the privacy settings.

Firefox web browser

Choose whether to accept or not cookies from web site sin the Firefox web browserClick “Tools” -> “Options” -> “Privacy section and choose whether you want Firefox web browser to accept cookies from web sites. Also configure different options and exceptions.

Google Chrome

Restrict or block cookies in Google Chrome using the options in the Under the Hood tabFrom the “Wrench” icon, choose “Options” and then move to the “Under the Hood” tab. In the “Cookies” section select the option for restricting or blocking web site cookies.

Apple Safari

Choose to accept web site cookies or otherwise in Apple Safari web browserOpen the Preferences window (“Tools” -> “Preferences“). Under the “Security” you shall find the settings and options for accepting cookies for the Apple Safari web browser.

Opera

The cookies options and settings of Opera web browserFrom the “Tools” menu, select “Preferences” to bring up a pop-up. The Cookies options are found under the “Advanced” tab… you need to click on the “Cookies” link from the list on the left to bring up the various options.

What kind of information is stored in browse cookies?

Cookies can store any kind of information though there is generally a limit to the length to the data and file size. But cookies cannot pick up and store your personal details such as name or email address on their own unless you provide it on the web site. Having said that, even if you do submit your personal details, it is up to the web developer and the “cookie-creating” program he wrote which will determine whether this information is kept in the cookie.

What is the importance of cookies?

Typically, cookies store information on how you’ve used a web site – your online activity. The best way to understand this is to take the wonderful example of web sites that have shopping carts. Generally, on these online applications, the contents of the shopping cart will be stored in a cookie. Each time you change the contents of the cart, by either adding more items or removing ones you don’t want, the cookie will be modified. When you finally decide to place the order, all the information in the cookie sent back to the web site so that the total can be calculated.

Though there is no persistency in transactions (read about the client-server architecture) over the web – each request and response by the web browser and server is handled as if it was the first one – cookies can help in tracking visitors and their activities.

Many popular web sites like Hotmail or Yahoo require the cookies option to be enabled to provide you with a smooth web experience. Opting not to accept cookies from such web sites will probably make them non-functional and this brings us to security issues when using cookies.

Are browser cookies a security concern?

Generally, NO! You don’t need to have security concerns regarding cookies unless you are working on a shared or public computer such as those in internet cafes and libraries. And in such cases, you should only take care not to have any important information such as username and password saved in a persistent form. Cookies are simple text files and they:

  • are not programs,
  • do not contain viruses,
  • cannot spread viruses, and
  • cannot write or read from your hard disk.

Sponsored Links

Your comments
Star icon IMPORTANT Have a question / problem? Click here to ask an expert.

Sponsored Links

Tips

How do I view a deleted web page?
Is there a way to view a deleted web page - one that is no longer available? Yes there is and the solution is quite simple. [more...]

Fact

The popular Dancing Baby animation which went viral in the 1990s employed no motion capture. Everything was created and rendered on the computer. The video was created using Autodesk 3ds Max (formerly 3D Studio Max). It was made by the team that had developed Character Studio, a tool for the 3D computer graphics program. The popularity of the Dancing Baby soared after John Woodell, a web developer, created an animated gif from the original movie and put it up on his employers web site. From there, the highly compressed animated gif file spread quickly around the world and started appearing on other web sites, commercials, music videos and even TV programs. Image Source: By [1], Fair use, https://en.wikipedia.org/w/index.php?curid=17625870 [more...]

We use cookies to give you the best possible website experience. By using WebDevelopersNotes.com, you agree to our Privacy Policy