Monitoring Sessions

<< Click to Display Table of Contents >>

Navigation:  Developer's Guide > Using Server Monitor (Server Control Panel) >

Monitoring Sessions

uniGUI Server Monitor also allows you to monitor individual sessions. In order to enable this feature you need to set the soEnableSessionMonitor option in the ServerModule.

Setting this option will enable the Sessions menu.






Choosing  Show Sessions menu item will open a new tab named Sessions.




In above grid you can see a list of all active sessions. It is a dynamic list and updated each 30 seconds. You can also manually update it using the refresh button. clip0216

You also have the option to terminate a single or all of the sessions remotely.


This option is not enabled by default. There are two ways to enable this option. First way is to permanently enable it through ServerModule option soEnableSessionMonitorAdmin. Second way it to selectively enable it in OnControlPanelLogin event using UniSession.AllowSessionAdmin property.


Below code snippet is a simple demo which shows how you can selectively enable admin mode for session management. Apparently, an actual implementation will require more steps to correctly verify user credentials.


procedure TUniServerModule.UniGUIServerModuleControlPanelLogin(ASession: TUniGUISession; const AUser, APassword: string;
                                                               var LoginValid: Boolean; LoginAttempt: Integer);
  if (AUser = 'valid admin user') and (APassword = 'strong pwd') then
    LoginValid := True;
    if LowerCase(AUser) = 'admin' then
      ASession.AllowSessionAdmin := True
      ASession.AllowSessionAdmin := False;


When admin mode is enable you will be granted the right to remotely terminate the sessions.

This can be done by choosing the trash bin icon under the Actions column and terminate the related session.

You can also the trash bin icon on the top tool bar and terminate all available sessions.