// Add smARTSession instance to dictionary collection by given session id.
 private void AddSession(string sessionId, SmartSession session)
 {
     // If session id already exist in dictionary, remove it, and add current session information.
     if (_sessions.Keys.Contains(sessionId))
     {
         _sessions.Remove(sessionId);
     }
     _sessions.Add(sessionId, session);
 }
        /// <summary>
        /// Get session object by session id.
        /// </summary>
        /// <param name="sessionId">Session id to match smARTSession instance.</param>
        /// <returns>An instance of smARTSession object to match session id.</returns>
        public SmartSession GetSession(string sessionId)
        {
            SmartSession session = (SmartSession)_sessions[sessionId];

            return(session);
        }
        /// <summary>
        /// This method is called when user login to initialize new session object
        /// and add an entry into dictonary against unique session id.
        /// </summary>
        /// <param name="userLoginId">Logged-in user id.</param>
        /// <param name="userName">Logged-in user name.</param>
        /// <param name="sessionId">Unique identifier for the session.</param>
        public void Login(Guid userLoginId, string userName, string sessionId)
        {
            SmartSession session = new SmartSession(userLoginId, userName);

            AddSession(sessionId, session);
        }