How to Clean Cookies

Cookies are little plain text files that your web browser produces at the request of web servers. It allows server programmers to store persistent data (data that will not disappear on the next request) on your computer for later access. This can be used to remember user information, login information, preferences, track marketing data, and provide extremely (though not 100%) secure authentication systems.

What is a cookie?

A server sets a cookie by sending a special Cookie header to your browser when you make a request. This cookie header can be ignored by your browser, but by default most browsers accept cookies (at least 'first party' cookies, but you do not need to worry about that just now). If the browser is accepting cookies, then the contents of the cookie are written in a text file, often with the name of the domain that the header was sent from. The text file also records an expiration date, a name for the cookie, and a couple other pieces of information. Cookies are limited bgy RFC 2109, and you can see on Micrsoft's page that Internet Explorer was written with these limitations in mind.

The way cookies provide persistent information is by sending the contents of all the cookies for a given domain in the request to the server every single time after the cookie has been set with a Cookie header. This is great, and useful, and wonderful, and dangerous. Read on to find out why.

Why do I need to clean them?

Strictly speaking you really do not have to clean your cookies. However, cookies really can store anything that the web server programmer chooses to store. Sometimes this can be malicious, or sometimes just a mistake. Either way, if you enter sensitive information on your computer (banking information, login information, personal and private information) it could be stored on your computer in an area you are not aware of. Furthermore, this information is blindly sent to any server that your computer thinks is from the domain shown by the cookie file. It can happen that your browser gets confused or tricked, and you start sending this cookie information to other servers - and that can indeed be dangerous.

After all that fear mongering, should you remove them? Well, I only enter personal information on websites that I really trust: my webmail provider, my only online banking system, and software I write myself. Other than that, I pretty much never enter anything personal, so I really do not worry too much about deleting my cookies. However, many people use the Internet pretty indiscriminately, and as well they should. You really do not want to be looking over your shoulder all the time. Unless you can think of a good reason not to, it can be pretty healthy to clean out your cookies every so often - I would suggest a week. So now, how?

How to clean out your cookies

This can actually be a bit more challenging than you might think - simply because there are so many browsers, each with its own ways to clean out the cookies. More importantly, if you ever use more than one browser, you will have cookies from each of them! Let's look at the most popular browsers:

Open up your Internet Options, either via Start -> Control Panel -> Internet Options, or by opening IE 6 and going Tools -> Internet Options. Once here, the default area 'General' shows a Delete cookies... button. Click that, and with confirmation, delete all the cookies on your computer that Internet Explorer 6 has written.

Very similar to IE 6, IE 7 requires that you go to Tools -> Internet Options. Next you should see a Delete... button. Click that, and a new dialog appears. Click Delete cookies..., confirm with Yes, and now the cookies are all deleted.

A little different from the IE series from Microsoft, Mozilla Firefox requires that you click Tools -> Options, and then go to the Privacy tab. Click Show Cookies..., then Remove All Cookies. Finished!

Is there a way to block cookies?

Yes, you can block cookies, however I highly recommend against doing so. It can severely impact your browsing experience for little gain. We may discuss how to do this in a later article, or you can check out this guide or this one for Firefox.

Good luck!

Related content: