The HTTP protocol uses only the request and the immediate response to that request. It is not possible to keep a running session between the client and the server. It is not possible to keep any information between two requests to the server.
Netscape solved this problem by establishing a simple relation, during which it is possible to pass information from the server response to the subsequent request(s). The server writes a small piece of data called a cookie into its response. The
Cooke is written in the Set-Cookie header line. The client repeats this cookie in the next request to this server in the Cooke header line. This creates a session that is not intended as a persistent TCP connection, but as a logical session created from ...