Session Tracking

HTTP is a stateless protocol. It means that each request is treated as an independent transaction that is unrelated to any previous request so that the communication consists of independent pairs of request and response.

But sometimes you need to keep conversational state with the client across multiple requests. A shopping cart wouldn’t work if the client had to make all his choices and then checkout in a single request.

Session tracking is the technique to maintain the current state (user data).  It’s all so known as Session Management. There’re several techniques:

  • URL rewriting
  • Hidden fields
  • Cookies
  • Session objects

All of these techniques & examples will be discussed in the next chapters.