wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Topic: Sessions in Operating system

profile
Rudra Sachapara
Sep 10, 2024
0 Likes
0 Discussions
133 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

Elegant fashion style

Blog banner

Data carving - using hex editor

Blog banner

A little bit of salt is all the hash needs!

Blog banner

Concurrency and Deadlocks

Blog banner

Raid

Blog banner

Why Soft Skills Matter as Much as Grades?

Blog banner

Top 5 Post-Wedding Skin Care Tips

Blog banner

Benefits of yoga and meditation

Blog banner

Internet of Things

Blog banner

Veg/Non-veg/Egg Tiffin Meals That Are Nutritious and Filling

Blog banner

Data Science in Healthcare: Predicting Diseases

Blog banner

Security Threats Faced and Countermeasures adopted by Organizations to avoid them

Blog banner

Operating system and overviews

Blog banner

Digital Footprints An Emerging Dimension of Digital Inequality

Blog banner

Types of email

Blog banner

Tea, Coffee, Red Wine, and Teeth: A Stain Survival Guide

Blog banner

Types Of scheduling

Blog banner

Types of OS

Blog banner

Instagram

Blog banner

What is a geographic information system (GIS)?

Blog banner

DATA BREACH CAUSES CHALLENGES PREVENTION AND FUTURE DIRECTIONS

Blog banner

38_Network Sniffing Techniques_SBC

Blog banner

Importance Of Yoga.

Blog banner

Review on Recovering Deleted Files

Blog banner

Hacking of web server and application

Blog banner

How International Schools Build Global-Minded Students through Curriculum & Activities

Blog banner

De-Coding Love

Blog banner

Types Of Interrupt

Blog banner

10 Interesting facts you should know!!!

Blog banner

Apple

Blog banner

Firewall

Blog banner

Tracking Emails & Email Crimes

Blog banner

Threads

Blog banner

Tableau

Blog banner

Service Strategy In ITSM

Blog banner

A Journey By Train

Blog banner

How China Regained It's World's Largest Growing Economy Status

Blog banner

Automating OSINT tasks for efficient Cyber Forensics Investigations

Blog banner

Cache memory

Blog banner

Instagram Features in 2023 That Will Leave You Stunned!

Blog banner

Cyber Forensic in the Banking sector

Blog banner

Electronic Funds Transfer

Blog banner