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

The New Role of Social Media Managers: Beyond Posting Content

Blog banner

What is Internet

Blog banner

Amazon

Blog banner

Im Photographer

Blog banner

Principal of concurrency

Blog banner

Memory Management in Operating System

Blog banner

38_Network Sniffing Techniques_SBC

Blog banner

Types of Threads

Blog banner

The War With Cold On Earth

Blog banner

Computer security techniques

Blog banner

RAID_142

Blog banner

MIDDLE CLASS MELODIES!!

Blog banner

A-B-C of Networking: Part-1 (Basics)

Blog banner

memory cache

Blog banner

Not anti-social, but pro-solitude

Blog banner

Service transition principles

Blog banner

?What Children Learn Between Activities: The Hidden Learning Moments in a Preschool Day

Blog banner

Kernel Modes: User Mode vs. Kernel Mode - 80

Blog banner

Some facts about Technology

Blog banner

What is the point of living if we can die at any moment of our lives ?

Blog banner

How to tie a Tie

Blog banner

How to Grow Your Brand on YouTube Without a Big Budget

Blog banner

Internet of Things and cyber security

Blog banner

How to Compare Schools Before an Admission Decision

Blog banner

A Day in the Life at Elzee: What Your Child Does Between Drop-Off and Pick-Up

Blog banner

Virtual memory

Blog banner

Uber

Blog banner

Data Security must be your Priority!

Blog banner

Digital Marketing Ethics Transparency Trust And Brand Reputation digital

Blog banner

Utilizing Data-Hiding and Retrieval Techniques in Cyber Forensics

Blog banner

Understanding Input Based Keylogger Activation Systems: Risks and Mitigation

Blog banner

Deadlock and Starvation

Blog banner

How to Encrypt and Decrypt Using GNU PGP

Blog banner

DEVELOPMENTS LEADING TO MODERN OPERATING SYSTEMS

Blog banner

10 Survival Tips that might save your life

Blog banner

This too shall pass

Blog banner

Guidelines for a Low sodium Diet.

Blog banner

All you need to know about “On-page SEO”

Blog banner

Software

Blog banner

The application udemy

Blog banner

COMMUNICATION

Blog banner

Precision-Recall in Data Science

Blog banner