Sesion - What is a session

Reprinted from: https: //blog.csdn.net/qin_xiaofang/article/details/77725946

Online collection:
the Session on behalf of a session server and browser, this process is continuous, it can be intermittent. In the Servlet, JSP page when there is no explicit prohibition of the session when, in the first request to open the browser to the jsp, the server will automatically create a session, and give it a sessionID, sent to the client browser. Then later when the client requests other resources in the present application, it will be automatically added to the request headers: (Cookie: JSESSIONID = get the first client session ID). The server cookie is automatically generated, his max-age -1, loose hi only current browser effectively. Close the browser fails, the sub-window browser share, each browser window does not share. In this way, the server receiving the request and they will receive a session ID, and in accordance with session objects created before the ID found in memory, provide to the requesting use.
This situation maintain an association between the different users of the same request issued by the user between the multiple HTTP connection is properly termed a maintenance session (the session)
. 1, tcp establish connection
2, the request document
3, issues a response document
4, the connection release tcp


Own understanding:
the establishment of a tcp connection, but many times you can send an HTTP request, session recording user information, so they can judge these requests come from the same user. Such as Taobao, when added to browse a wide variety of goods, it is many times HTTP requests. For example, visit the company's home page, etc.

Guess you like

Origin www.cnblogs.com/FengZeng666/p/11616749.html