Implement login/logout functionality.