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?


  • 1
    Can you provide the context for "http session "?
    – Ron Trunk
    Jul 25 '16 at 21:05
  • The OSI model layers 5, 6, and 7 were never really implemented by OSes, and are basically ignored by programmers due to the lack of OS support.
    – Ron Maupin
    Jul 26 '16 at 2:56
  • IPv4 1982, OSI Model 1984; "The OSI model provides a common basis for the coordination of standards development for the purpose of systems interconnection, while allowing existing standards to be placed into perspective within the overall reference model." horses mouth here Jul 27 '16 at 0:47
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can post and accept your own answer.
    – Ron Maupin
    Jan 3 at 5:50

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.

  • but a tcp connection can hold multiple http sessions one after another. Isn't this called persistent connection in Tanenbaum's Computer Network?
    – Tim
    Jul 26 '16 at 2:26
  • It's one http session per tcp session
    – Ron Trunk
    Jul 26 '16 at 2:27
  • I should say tcp connection
    – Ron Trunk
    Jul 26 '16 at 2:28
  • The first quoted sentence is the totality of it. It's a sequence of (related) requests. They can come across a single connection, a bunch of connections, even across a number of servers. For example, the "HTTP session" of this page is all three of those.
    – Ricky
    Jul 26 '16 at 3:27
  • See Window.sessionStorage. An HTTP 'session' is understood to be up as long as the HTTP client, typically a browser, maintains the response data in memory. Wikipedia specifically says HTTP sits at the Session Layer [see here]. You are confusing connectionless / stateless nature of HTTP with the concept of session. Jul 26 '16 at 4:39

An HTTP session is a type of session layer communication. Wikipedia.

There's also the Internet Protocol Suite which has categorizes it in the Transport Layer.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.