Lably
Skip to content

Session (computer networking)

Temporary context for interactive information interchange

  • 6 min read
  • 4 chapters

Related on Lably

Through Computer science, Computer network and Automation

An established session is the basic requirement to perform a connection-oriented communication. A session also is the basic step to transmit in connectionless communication modes. However, any unidirectional transmission does not define a session.

Communication Transport may be implemented as part of protocols and services at the application layer, at the session layer or at the transport layer in the OSI model.

  • Application layer examples:
    • HTTP sessions, which allow associating information with individual visitors
    • A telnet remote terminal session
  • Session layer example:
  • Transport layer example:
    • A TCP session, which is synonymous to a TCP connection, or an established TCP socket.

In the case of transport protocols that do not implement a formal session layer (e.g., UDP) or where sessions at the protocol level are too short-lived, sessions are maintained by a higher level program. For example, a HTTP exchange between a browser and a remote host that includes a HTTP cookie with a unique session ID may identify a state such as information about the user's preferences or authorization level.

Maintaining session continuity between HTTP requests requires a session ID. The session ID is embedded within the <A HREF> or <FORM> links of dynamic web pages so that it is passed back to the CGI. CGI then uses the session ID to ensure session continuity between transaction phases.

Session affinity

When a client may connect to any server in a cluster of servers, a special problem is encountered in maintaining consistency when the servers must maintain session state. The client must either be directed to the same server for the duration of the session, or the servers must transmit server-side session information via a shared file system or database. Otherwise, the client may reconnect to a different server than the one it started the session with, which will cause problems when the new server does not have access to the stored state of the old one.

A method of using server-side sessions without persistent storage is to utilize RAM for storage of session data.

Sign in to keep reading

3 more chapters are free with a Lably account.

More in Computing and communication