protected function extractAuthCookies($result){

		$authCookies = array();
		$cookie_payload = '';

		$header_array = explode("\r\n", $result);

		// Get the two auth cookies
		foreach($header_array as $header) {
			$loop = explode(":",$header);
			if (strtolower($loop[0]) == 'set-cookie') {
				$authCookies[] = $loop[1];
			}
		}

		// Extract cookie name & payload and format in to cURL compatible string
		foreach($authCookies as $payload){
			$e = strpos($payload, "=");
			// Get name
			$name = substr($payload, 0, $e);
			// Get token
			$content = substr($payload, $e+1);
			$content = substr($content, 0, strpos($content, ";"));

			// If not first cookie, add cookie seperator
			if($cookie_payload !== '') $cookie_payload .= '; ';

			// Add cookie to string
			$cookie_payload .= $name.'='.$content;
		}

	  	return $cookie_payload;
	}