Session creates http basic credentials
refactored setting request auth header intoseparate function