@@ -37,6 +37,7 @@ class Curl
37
37
private $ completeFunction = null ;
38
38
39
39
private $ cookies = array ();
40
+ private $ responseCookies = array ();
40
41
private $ headers = array ();
41
42
private $ options = array ();
42
43
@@ -304,7 +305,7 @@ public function exec($ch = null)
304
305
$ this ->rawResponse = curl_exec ($ this ->curl );
305
306
$ this ->curlErrorCode = curl_errno ($ this ->curl );
306
307
}
307
-
308
+ $ this -> responseCookies = array ();
308
309
$ this ->curlErrorMessage = curl_error ($ this ->curl );
309
310
$ this ->curlError = !($ this ->curlErrorCode === 0 );
310
311
$ this ->httpStatusCode = curl_getinfo ($ this ->curl , CURLINFO_HTTP_CODE );
@@ -402,7 +403,7 @@ public function head($url, $data = array())
402
403
public function headerCallback ($ ch , $ header )
403
404
{
404
405
if (preg_match ('/^Set-Cookie:\s*([^=]+)=([^;]+)/mi ' , $ header , $ cookie ) == 1 ) {
405
- $ this ->cookies [$ cookie [1 ]] = $ cookie [2 ];
406
+ $ this ->responseCookies [$ cookie [1 ]] = $ cookie [2 ];
406
407
}
407
408
$ this ->rawResponseHeaders .= $ header ;
408
409
return strlen ($ header );
@@ -543,13 +544,13 @@ public function setCookie($key, $value)
543
544
}
544
545
545
546
/**
546
- * get Cookie
547
+ * get Cookie of Response
547
548
*
548
549
* @access public
549
550
* @param $key
550
551
*/
551
- public function getCookie ($ key ) {
552
- return $ this ->cookies [$ key ];
552
+ public function getResponseCookie ($ key ) {
553
+ return $ this ->responseCookies [$ key ];
553
554
}
554
555
555
556
/**
0 commit comments