Difference between session, HTTP connection?

I read this and this . After reading, I was very confused with my basics. Please help me as this is related to the basics of networking and JSPs and servlets.

Consider this hypothetical situation:

If I open the site www.xyz.com in some browser and do nothing on this page in a day.

Q.1. This means that the same connection still exists if the next day I ask for something from this page. Given the connection: keep-alive exists.

Q.2 How does a session work in this context? I found that if the session has expired, then there will be a connection, so what is the difference between HTTP Connection and Session? Like what happens when we open several Facebook tabs in the same browser (is this the same session, but a different connection? Is it correct?)

Q.3 As mentioned in this article

An important enhancement to the HTTP 1.1 standard is persistent connections. In HTTP 1.0, the connection between the web client and the server is closed after one request / response cycle. In HTTP 1.1, a connection is supported and reused for multiple requests. Persistent connections significantly reduce communication latency because the client does not need to rewrite the TCP connection after each request.

How does the browser support a persistent connection?

: , -

+4
1

:

A1: , . Keep-Alive ( HTTP) , .

A2: . Keep-Alive. ( , ). : , , . cookie. , cookie, .

A3: TCP/IP. .

+3

Source: https://habr.com/ru/post/1614433/


All Articles