Cookie

Maintain user/server state

HTTP GET/response is stateless, so in the server, we always create a cookie for each client, so that in following transactions, the server can track the request state of each client.

Privacy

In each website, it always asks for your sancation for the cookies, you can browse a new webpage that you never browsed before to try it.

Components

  1. cookie header line of HTTP response message
  2. cookie header line in next HTTP request message
  3. cookie file kept on user’s host, managed by user’s browser
  4. back-end database at website
  • unique ID (aka “cookie”)
  • entry in backend database for ID

Working process

Here is a graph to show how a cookie works

Previous
Next