Refactored get_username_and_password - introduced sessions