<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def disconnect(self):
 """ Ends a client authentication session, performs a logout and a clean up. """

        if self.r_session:
            self.session_logout()

        self.r_session = None
        self.clear()