Logging Off and Ending Sessions
- Last UpdatedNov 06, 2025
- 1 minute read
The LogOff method of the Session class is used to log off entities and users (aaMES.Core.aaSession.LogOff( sessionId, userId, entName, siteName, logOffTime )). If the session is no longer required, then use the EndSession() method (aaMES.Core.aaSession.EndSession( sessionId) ). This will remove the entry in the database.
See the following example:
LogoffEnt Script Example
if me.SessionID > 0 then
'aaMES.Core.aaSession.LogOff( sessionId, userId, entName, siteName, logOffTime );
Result = aaMES.Core.aaSession.LogOff( me.sessionId, me.MES.userId, me.EntityName, "", null );
Result = aaMES.Core.aaSession.EndSession( me.sessionId );
if me.debug then
LogMessage("Factelligence Session Ended");
endif;
endif;