Does session in “http session” mean the same as in “session layer” in OSI model

osi

Does session in "http session" mean the same as in "session layer" in OSI model?

Is a http session a session in the context of "session layer" in OSI model?

Is a http session only a pair of request and response, or can it be a sequence of multiple pairs of requests and responses? If latter, when is a http session determined to be ended?

Thanks.

Best Answer

I have to disagree with @ronroyston here. The OSI model is an idealized abstract model, and there are no protocols in use today that follow it. HTTP was created without regard to the OSI model, so there's no point to trying to make it fit. The TCP model is a little closer, because it lumps everything above transport into "application."

As the Wikipedia article says,

An HTTP session is a sequence of network request-response transactions. An HTTP client initiates a request by establishing a Transmission Control Protocol (TCP) connection to a particular port on a server.

So a HTTP session is created by establishing a TCP connection. It follows that the session ends when the TCP connection is terminated.

Ultimately, many definitions like this are a bit squishy, so they can mean what you want them to mean. Just don't get too hung up on figuring out the OSI model. It's just a model.

Related Topic