ArticleslgStudy

computer science

Session (computer networking)

Session (computer networking) is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Session (computer networking) rather than just read about it. In short: In computer science and networking, a session is a two-way link, a relatively high layer in the OSI stack enabling interactive information exchange between two or more communication devices or ends – be they computers, automated systems, or live active users (see login session). A session is established at a certain point in time, and then 'torn down' - brought to an end - at some later point.

Key takeaways

  • Session (computer networking) belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Session (computer networking) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Session (computer networking) from memory before moving on to harder problems.

Reference excerpt

In computer science and networking, a session is a two-way link, a relatively high layer in the OSI stack enabling interactive information exchange between two or more communication devices or ends – be they computers, automated systems, or live active users (see login session). A session is established at a certain point in time, and then 'torn down' - brought to an end - at some later point. A session may involve more than one message in each direction. A session is typically stateful, meaning that at least one of the communicating parties needs to hold current state information to be able to communicate. 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: A Session Initiation Protocol (SIP) based Internet phone call 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.

Client-side web sessions Client-side sessions use cookies and encryption to preserve state on the client without storing data on the server. When presenting a dynamic web page, the server sends the current state data to the client (web browser) in the form of a cookie. The client saves the cookie in memory or on disk. With each successive request, the client sends the cookie back to the server, and the server uses the data to "recall" the state of the application for that specific client and generate an appropriate response. To accomplish this securely, the server needs to encrypt the session data before sending it to the client, and modification of such information by any other party should be prevented via cryptographic means. Transmitting state back and forth with every request is only practical when the size of the stored information is small.

HTTP session token

A session token is a unique identifier that is generated and sent from a server to a client to identify the current interaction session. The client usually stores and sends the token as an HTTP cookie and/or sends it as a parameter in GET or POST queries. The reason to use session tokens is that the client only has to handle the identifier—all session data is stored on the server (usually in a database, to which the client does not have direct access) linked to that identifier. Examples of the names that some programming languages use when naming their HTTP cookie include JSESSIONID (JSP), PHPSESSID (PHP), CGISESSID (CGI), and ASPSESSIONID (ASP).

Session management

In human–computer interaction, session management is the process of keeping track of a user's activity across sessions of interaction with the computer system. Typical session management tasks in a desktop environment include keeping track of which applications are open and which documents each application has opened, so that the same state can be restored when the user logs out and logs in later. For a website, session management might involve requiring the user to re-login if the session has expired (i.e., a certain time limit has passed without user activity). It is also used to store information on the server-side between HTTP requests.

Desktop session management A desktop session manager is a program that can save and restore desktop sessions. A desktop session is all the windows currently running and their current content. Session management on Linux-based systems is provided by X session manager. On Microsoft Windows systems, session management is provided by the Session Manager Subsystem (smss.exe); user session functionality can be extended by third-party applications like twinsplay.

Browser session management Session management is particularly useful in a web browser where a user can save all open pages and settings and restore them at a later date or on a different computer (see data portability). To help recover from a system or application crash, pages and settings can also be restored on next run. Google Chrome, Mozilla Firefox, Internet Explorer, OmniWeb and Opera are examples of web browsers that support session management. Session management is often managed through the application of cookies.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Session (computer networking)

Start with the simplest possible case. Write down what Session (computer networking) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Session (computer networking) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Session (computer networking) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Session (computer networking)

In research
Session (computer networking) appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Session (computer networking) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Session (computer networking) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computer networking, so understanding it makes those chapters shorter.
In everyday life
Look for Session (computer networking) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Session (computer networking)” →

How to study Session (computer networking) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Session (computer networking) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Session (computer networking) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Session (computer networking) in simple terms?

In computer science and networking, a session is a two-way link, a relatively high layer in the OSI stack enabling interactive information exchange between two or more communication devices or ends – be they computers, automated systems, or live active users (see login session). A session is establ…

Why does Session (computer networking) matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Session (computer networking)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Session (computer networking).

Tags

  • Computer networking

Keep exploring