A protocol is a defined set of rules that governs a procedure. In the case of the internet, the Hypertext Transfer Protocol or HTTP is used to define the format of communication between entities and the actions to be taken upon receipt of the communication. This ensures that no conflict arises in needs and procedures regardless of the location of the user and the source of data. Owing to this standardization, the World Wide Web is accessible anywhere in the world and can be used in a similar fashion by all with access. An example of the application of HTTP is when a user requests a web page, and the server sends back the page to the user machine. HTTP is traditionally stateless and stores no information on the past requests made by the user. The client initiates a connection via a port to the server; the server accepts the request and sends data via the identified port. When data has been sent, the port is closed.
In non-persistent mode, HTTP allows a client to send multiple objects over a single port connection. This suggests, on receipt of data requested, the same port can be used to make other requests back to the server. An example is where the client requests a page from the server. Upon receipt, the client logs in via the same connection, and upon logging in, a download begins via the same open connection. This reduces the average response time since there is no loss in initiating and opening a new port connection. The persistent mode of HTTP requires that a single port connection is used only to convey a single message at a time. This incurs a huge time overhead as each new connection includes time to make a request, allocate a port and initiate the connection. Since HTTP is stateless, the concept of cookies was developed to allow some state information to be stored about the client and the session. When the client initially visits the site, some data is stored on the site server, and a copy is sent to the client machine. Using this cookie, any future requests can easily identify the client and the actions. This data can be used to form some opinions about the client, e.g., range of their monthly expenditure, etc.