tomcatservletswebserverweb-container

How can web server/web container tell several requests are from the same client?


I am reading the < Head First Servlets and JSP >. It says:

The session persists across multiple requests from the same client.

So I am wondering how Web Server or Web Container tell several requests are from the same client?

I guess it should use a combination of IP, User Agent, URL.

Am I right?


Solution

  • Using cookies. If cookies are disabled, it may use URL parameters.

    For example, for Tomcat, the cookie is called JSESSIONID and its value is an alphanumeric string that the container associates with your session.