wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Sessions In OS.

profile
Shubham Yadav
Sep 11, 2024
0 Likes
0 Discussions
135 Reads

In an operating system (OS), a **session** generally refers to the period of time when a user or a process is actively using the system. Sessions are essential for managing user interactions, processes, and resources efficiently. Below are a few different types of sessions and their significance:


### 1. **User Sessions**

- A user session begins when a user logs into the system and ends when they log out. During this session, the OS maintains all processes, user files, and settings related to the user’s activity.

- Each user session typically has its own environment, including file permissions, access rights, and running applications.


### 2. **Terminal/Console Sessions**

- In systems like Linux or Unix, terminal sessions are created when a user opens a terminal or console. Each terminal session can run commands independently, with its own process ID (PID).

- **TTY (Teletype Terminal)** sessions: Text-based input/output streams, often seen in Unix-like operating systems.

- **PTY (Pseudo Terminal)** sessions: Used for creating terminal emulation, often by software like SSH.


### 3. **Network Sessions**

- Network sessions manage connections between a client and a server. These sessions are crucial in handling data transmission, ensuring proper communication between systems.



### 4. **Session Management in Windowing Systems**

- In graphical desktop environments (like GNOME, KDE), a session includes not only the user’s login state but also all open windows, running applications, and system preferences.

- These sessions may allow users to restore the desktop environment to the previous state upon re-login.


### 5. **Session Management in Web/Network Applications**

- Web applications create **sessions** to manage user state over stateless HTTP. A session in web terms might involve tracking user activities, login status, preferences, and shopping cart items.

- Sessions are managed using cookies or session tokens, which allow web servers to recognize consecutive requests from the same user.


### 6. **Process Sessions**

- In Unix-like operating systems, a session is a collection of one or more processes created by a single login.

- Processes in the same session share the same session ID (SID). A session leader (usually a shell) can create new processes within the session.

- Sessions are typically grouped into **process groups** and can be controlled by job control signals such as `SIGTERM` (terminate), `SIGHUP` (hang up), etc.


### 7. **Session Management in Virtualization/Containers**

- In environments like Docker or virtual machines, sessions refer to the time period when a user or process interacts with a virtual instance or container. Each container or VM operates within its own session and namespace, isolated from others.


### Commands to Manage Sessions:

- **`who`**: Shows users currently logged in.

- **`w`**: Displays active user sessions along with what they are doing.

- **`ps`**: Displays process information, including sessions and groups.

- **`loginctl`** (Linux): Manages and inspects user sessions.

- **`kill`**: Used to terminate a session by killing processes related to it.


Comments ()


Sign in

Read Next

UniProcessor Scheduling

Blog banner

Improving defences Proxy Device(defense in depth)

Blog banner

Operating Systems Overview

Blog banner

Memory Hierarchy

Blog banner

Celebrate Diwali the Delicious Way with Meal Maharaj Catering

Blog banner

Which Smartphone Company Has the Largest Market Share in India?

Blog banner

QUANTUM COMPUTING IN SECURITY:A GAME CHANGER IN DIGITAL WORLD

Blog banner

Data Warehousing

Blog banner

Importance of Network Security Risk

Blog banner

Secure Hypertext transfer protocol

Blog banner

Operating System

Blog banner

ACHIEVEMENTS IN OPERATING SYSTEMS

Blog banner

Is Brushing After Eating Damaging Your Teeth? (Fact or Myth)

Blog banner

Trends that began during the pandemic

Blog banner

Title: Modern Operating Systems: Powering the Digital Era

Blog banner

Breaking the Cycle of Loneliness : Protecting your Mental Health Through meaningful Connection ( Part — 2)

Blog banner

Raising mental health burden: A global and Indian perspective

Blog banner

Deadlock

Blog banner

An Overview of Virtual Machines

Blog banner

Virtual Memory

Blog banner

Child labour

Blog banner

BLOCKCHAIN MACHANISM

Blog banner

Software

Blog banner

21ST CENTURY PATRIARCHY

Blog banner

Memory management

Blog banner

Deadlock

Blog banner

Best password managers: Reviews of the top products

Blog banner

Vulnerability Assessment (Vulnerability Analysis)

Blog banner

Thumb Sucking: When It’s Normal and When It Becomes a Dental Problem

Blog banner

Fossil Hunting 101 at the Peace River, Arcadia, Florida, USA

Blog banner

Fitness regime by Deepesh

Blog banner

5 Things I As A Dentist Would Never Do (And What You Can Learn From It)

Blog banner

Things You Should Leave Behind In 2025, Whilst In 2026

Blog banner

You'll get to know about Pankaj Negi

Blog banner

Impacts of Data Breach On Companies Challenges and Prevention

Blog banner

PHISHING

Blog banner

Elements and Principles of Photography

Blog banner

Hey Aryan here

Blog banner

Processes : Process description and control

Blog banner

Big O Notation

Blog banner

Memory management and virtual memory

Blog banner

John Titor: The Time Traveler

Blog banner