An expresson of my interests in Web 2.0 and everything beyond and other than it.

Sunday, April 20, 2008

Need some Cookies...?

The challenge is how to record the fleeting dialog between a web server and the web browser. Yes, I like to refer to the transactions between servers and browsers as a dialog. The browser sends a request for a resource to the server and the server responds appropriately with a response. You could discern a rather interesting and lively conversation if you dare to listen!

In 1994, Lou Montulli of Netscape Communications kind of discovered the "cookie" we know of today. Soon there was the initial cookie specifications and, first, Netscape in 1994 ,and then, Internet Explorer in 1995 started cookie support in their browsers. Web developers found many uses for the cookie including tracing a browser session. Since then cookies have become an important analytics tool.

To understand how cookies can help in web analytics its important to understand how cookies themselves work:

Wikipedia.org defines cookie as "a packet of information sent by a server to a World Wide Web browser and then sent back by the browser each time it accesses that server." Cookies are stored in the user's computer, ready for future access. Each cookie has an unique name and the data it stores can be read by the server which sets it. Web analytics systems use this technology rather effectively to track each individual user. The idea that works in this case is, each cookie is unique to each user. The cookie data may store an unique ID assigned to that computer, and whenever there is a request from the browser for a resource on the server which had originally set that cookie, the server can read the cookie data and assess whether its the same machine which had requested another resource only seconds back. This somewhat emulates a situation in which the "state" can be captured. With the help of a cookie this time, in the Spanish guy example from the previous post, the server can distinguish between two Spanish guys a little more effectively.

So you see, how kind and benevolent our servers can be at times...always keen to give away some warm homemade cookies to whoever comes knocking!

No comments: