Session States
The SessionState reflects all session states that can occur during its lifetime and what a specific state means.
The State property returns the current session state.
Tracking Session State Changes
To be notified about a session state change, subscribe to the StateChanged event.
Example
session.StateChanged += (sender, args) => Console.WriteLine($"Session state was changed from {args.PreviousState} to {args.NewState}.");