protected function configureAuthCookies($location) {

		// Get endpoint "https://somthing.sharepoint.com"
		$location = parse_url($location);
		$endpoint = 'https://'.$location['host'];

		// get username & password
		$login = $this->{'_login'};
		$password = $this->{'_password'};

		// Create XML security token request
		$xml = $this->generateSecurityToken($login, $password, $endpoint);

		// Send request and grab returned xml
		$result = $this->authCurl("https://login.microsoftonline.com/extSTS.srf", $xml);

		
		// Extract security token from XML
		$xml = new \DOMDocument();
		$xml->loadXML($result);
		$xpath = new \DOMXPath($xml);

		// Register SOAPFault namespace for error checking
		$xpath->registerNamespace('psf', "http://schemas.microsoft.com/Passport/SoapServices/SOAPFault");

		// Try to detect authentication errors
		$errors = $xpath->query("//psf:internalerror");
		if($errors->length > 0){
			$info = $errors->item(0)->childNodes;
			throw new \Exception($info->item(1)->nodeValue, $info->item(0)->nodeValue);
		}

		$nodelist = $xpath->query("//wsse:BinarySecurityToken");
		foreach ($nodelist as $n){
			$token = $n->nodeValue;
			break;
		}

		if(!isset($token)){
			throw new \Exception("Unable to extract token from authentiction request");
		}

		// Send token to SharePoint online in order to gain authentication cookies
		$result = $this->authCurl($endpoint."/_forms/default.aspx?wa=wsignin1.0", $token, true);

		// Extract Authentication cookies from response & set them in to AuthCookies var
		$this->authCookies = $this->extractAuthCookies($result);
	}