Description:
------------
Hello,
we have found the following problem:
If you use the PHP SoapClient and the endpoint returns some cookies, the cookies get added to the subsequent requests, but there is an additional semicolon appended.
Example:
Cookie: testcookie1=true;testcookie2=true;
According to the RFC I've read this is not neccessary.
The problem is now that we are trying to consume a web service that unfortunately returns a "400 Bad Request" error because of this semicolon.
Test script with an other webservice is appended to see the cookie header in the request.
I have tried this with the lastest PHP versions of 7.0, 7.1 and 7.2 - same result.
Thank you!
Test script:
---------------
$client = new SoapClient("http://ec.europa.eu/taxation_customs/vies/services/checkVatService?wsdl", array('trace' => true));
$client->__setCookie('testcookie1', 'true');
$client->__setCookie('testcookie2', 'true');
try {
$response = $client->checkVat(array("countryCode" => 'TEST', "vatNumber" => 'TEST'));
} catch (Exception $e) {
echo "Exception caught:\n" . $e . "\n";
}
$requestLoggingData = "Request:\n" . $client->__getLastRequestHeaders() . "\n\n" . $client->__getLastRequest() . "\n\n";
$requestLoggingData .= "Response:\n" . $client->__getLastResponseHeaders() . "\n\n" . $client->__getLastResponse() . "\n\n";
$requestLoggingData .= "Cookies:\n" . print_r($client->__getCookies(), true);
echo $requestLoggingData;
Expected result:
----------------
No semicolon is prepended in the cookie header.