Moved the login code to ``login()``
Moved the logout code to ``logout()``