Bug #76232 [NEW]: SoapClient Cookie Header Semicolon
| From: | philipp dot kern at datenkraft dot com | Date: | Wed, 18 Apr 2018 08:31:20 +0000 |
| Subject: | Bug #76232 [NEW]: SoapClient Cookie Header Semicolon | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-214788@lists.php.net to get a copy of this message | ||
From: philipp dot kern at datenkraft dot com
Operating system: Ubuntu 16.04.4
PHP version: 7.0.29
Package: SOAP related
Bug Type: Bug
Bug description:SoapClient Cookie Header Semicolon
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.
--
Edit bug report at https://bugs.php.net/bug.php?id=76232&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76232&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76232&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76232&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=76232&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=76232&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=76232&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=76232&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=76232&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=76232&r=support
Expected behavior: https://bugs.php.net/fix.php?id=76232&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=76232&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=76232&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=76232&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76232&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=76232&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=76232&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=76232&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76232&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=76232&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=76232&r=mysqlcfg