'Disconnects any existing sessions with the same user.
args:
curr_session (Session): Disconnect all Sessions matching this one.
reason (str, optional): A motivation for disconnecting.'

def disconnect_duplicate_sessions(self, curr_session, reason=_('Logged    in    from    elsewhere.    Disconnecting.')):

    uid = curr_session.uid
    doublet_sessions = [sess for sess in self.values() if (sess.logged_in and (sess.uid == uid) and (sess != curr_session))]
    for session in doublet_sessions:
        self.disconnect(session, reason)
