Implement login and logoff.