Maintaining State
Although HTTP itself is stateless, the servlet container uses a simple strategy to manage state between requests. A servlet can store arbitrary data in a container-provided object called a session. The servlet container associates a unique ID with the session and returns the ID to the client. When another request arrives from the same client, the servlet container uses the unique ID to attach the session to the request. A servlet can maintain state with little effort, since the servlet container handles the mechanics.