Sessions
Caveats
Most if not all pages are just rough notes, and these pages as a whole are far from complete. More notes will be added in time, eventually, maybe.
If, from reading these notes, you conclude that I am off my rocker, you won’t be the first, and you may even be right. These pages may simply position me as an acolyte to the late Gene Ray.
No doubt there are a dozen and one reasons why none of this would ever work, but perhaps somewhere deep down there is a tiny fragment that could be used for something.
Contents
Sessions
A session is a set of one or more related processes. All the processes within a session share the same user account and permissions. The permissions assigned to a session control whether the session has visibility over and allowed interaction with the parent and ancestor sessions, sibling sessions and descendant sessions. The active sessions on a system form a hierarchy.
There are multiple session types, including:
- System service
- Interactive user session
- Scheduled task
- Remote command invocation
System services can run under the general system session or be assigned separate sessions for security. Services within their own session can still interact with processes outside of their session via message passing according to permitted channels, but processes outside of the session will not have direct access to the processes inside the session.
A session is created when a user signs in interactively. The user’s entire desktop experience, including the desktop environment and all of their open applications, can be a single session. However, some processes may wish to encapsulate themselves into a more restrictive inner session, such as browsers. Under such conditions, the browser would not be able to interact with the other applications that the user has open.
Each scheduled task will be given a session within which to execute. The ID associated with the schedule can act as a key to trace activity originating from the task. The task scheduler will log the session ID when starting the task, and this ID can be used when recording log entries for requests issued by the script against system services.
Remote command invocation will also generate a new session for each command.
Controlling sessions
A controlling session is a master session responsible for controlling workloads. Controlling sessions include:
- The operating system’s master controlling session
- The task scheduler
- Interactive user sessions
Task management software that shows and and tracks sessions should be sure to include all child sessions for the requested session ID. Likewise, when tracing a process and its session, it needs to be possible to trace the session back to the controlling session. That is, if a user process is running inside a child session, it must be possible to trace it back up to its controlling session, specifically the interactive user session under which it ultimately originated.
Sessions originating as scheduled tasks need to be able to be traced back to the task scheduler.
Session Manager
The Session Manager is the component responsible for creating, managing and terminating sessions, including the security assignments for sessions.