Bug #78162 [NEW]: cURL 7.64.0 does not allow to save cookies from a localserver

From: Date: Fri, 14 Jun 2019 10:58:40 +0000
Subject: Bug #78162 [NEW]: cURL 7.64.0 does not allow to save cookies from a localserver
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-221307@lists.php.net to get a copy of this message
From: alexandre at comsoftweb dot pt Operating system: Windows PHP version: 7.3.6 Package: Unknown/Other Function Bug Type: Bug Bug description:cURL 7.64.0 does not allow to save cookies from a localserver Description: ------------ --- From manual page: https://php.net/book.curl --- > curl version is 7.64.0 > ["features"]=> int(2428829) This "features" value does not have the PSL bit set (1<<20) which means this curl version suffers from a cookie parsing bug present in 7.64.0, fixed in 7.64.1 (commit 299d9660f85), that made curl not accept cookies on domain names without any dots. Solution: upgrade (or downgrade) curl. Test script: --------------- //this url is a local server, so bluepc has no dots in this url returns cookies $url = 'http://bluepc/ERPV18/api/Shell/LoginUser/'; //Initiate cURL. $ch = curl_init($url); //thiscookie file will never have any cookies in it because bluepc has no dots curl_setopt($ch, CURLOPT_COOKIEJAR, "C:/cookies/cookieFile.txt"); curl_exec($ch); curl_close($ch); Expected result: ---------------- cookiefile should have cookies inside like this # Netscape HTTP Cookie File # https://curl.haxx.se/docs/http-cookies.html # This file was generated by libcurl! Edit at your own risk. bluepc FALSE / FALSE 0 eti_sessionInfo YgBsAHUAZQBwAGMAXABzAHEAbAAyADAAMQA3AKcAcwBpAHMAdABlAG0AYQBfAGEAbABhAGMAbwCnAEEATABBAEMATwCnAEUAeAAgADIAMAAxADkApwAxAKcAUABUAC0AUABUAA== Actual result: -------------- but it only has the header and its empty # Netscape HTTP Cookie File # https://curl.haxx.se/docs/http-cookies.html # This file was generated by libcurl! Edit at your own risk. -- Edit bug report at https://bugs.php.net/bug.php?id=78162&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=78162&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=78162&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=78162&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=78162&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=78162&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=78162&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=78162&r=needscript Try newer version: https://bugs.php.net/fix.php?id=78162&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=78162&r=support Expected behavior: https://bugs.php.net/fix.php?id=78162&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=78162&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=78162&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=78162&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=78162&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=78162&r=dst IIS Stability: https://bugs.php.net/fix.php?id=78162&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=78162&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=78162&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=78162&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=78162&r=mysqlcfg

« previous php.bugs (#221307) next »