private void CleanupSession(SessionInfo session) { lock (_sync) { using (var service = new LoginService()) { try { try { service.Logout(session.Credentials.SessionToken.Id); } catch (Exception ex) { Platform.Log(LogLevel.Warn, ex, "Unable to terminate session {0} gracefully", session.Credentials.SessionToken.Id); } } finally { RemoveSession(session.Credentials.SessionToken.Id); } } } }
public void Logout(UserSessionInfo session) { using (LoginService service = new LoginService()) { service.Logout(session.SessionToken.Id); } }
public static void SignOut(SessionInfo session) { FormsAuthentication.SignOut(); if (session != null) { try { ForceOtherPagesToLogout(session); using (LoginService service = new LoginService()) { service.Logout(session.Credentials.SessionToken.Id); } } catch (NotSupportedException) { //ignore this. } catch (Exception e) { Platform.Log(LogLevel.Warn, e, "Failed to log user out."); } } }
public static void SignOut(SessionInfo session) { FormsAuthentication.SignOut(); if (session != null) { try { ForceOtherPagesToLogout(session); using (LoginService service = new LoginService()) { service.Logout(session.Credentials.SessionToken.Id); } } catch (NotSupportedException) { //ignore this. } catch (Exception e) { Platform.Log(LogLevel.Warn, e, "Failed to log user out."); } UserAuthenticationAuditHelper audit = new UserAuthenticationAuditHelper( ServerPlatform.AuditSource, EventIdentificationContentsEventOutcomeIndicator.Success, UserAuthenticationEventType.Logout); audit.AddUserParticipant(new AuditPersonActiveParticipant( session.Credentials.UserName, null, session.Credentials.DisplayName)); ServerPlatform.LogAuditMessage(audit); } }
private void CleanupSession(SessionInfo session) { lock (_sync) { using (var service = new LoginService()) { try { try { service.Logout(session.Credentials.SessionToken.Id); } catch(Exception ex) { Platform.Log(LogLevel.Warn, ex, "Unable to terminate session {0} gracefully", session.Credentials.SessionToken.Id); } } finally { RemoveSession(session.Credentials.SessionToken.Id); } } } }