作者:疯子jiushiwohaha | 来源:互联网 | 2023-05-19 18:09
FirstofallImusingcodeigniterandusedPhilSurgeoncodeigniter-curl:http:philsturgeon.co.uk
First of all I'm using codeigniter and used PhilSurgeon codeigniter-curl: http://philsturgeon.co.uk/code/codeigniter-curl
首先,我使用codeigniter并使用了phildesigner codeigniter-curl: http://philsturgeon.co.uk/code/codeigniter-curl。
I'm trying to curl and get the Set-COOKIEs from the response header from another domain. The code is below
我正试图卷起来,从另一个域的响应头获取集合COOKIE。下面的代码是
$url = 'http://ib.adnxs.com/ptv?id=1403122&size=1x1';
$this->curl->create($url);
$this->curl->http_header('User-Agent', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8');
$optiOns= array(CURLOPT_HEADER => 1);
$this->curl->options($options);
$vast= $this->curl->execute();
echo ""; print_r($vast);
returns this:
返回:
Set-COOKIE: sess=1; path=/; expires=Fri, 24-May-2013 01:58:10 GMT; domain=.adnxs.com; HttpOnly
Set-COOKIE: icu=ChIItcsCEAoYASABKAEwsu_1jAUQsu_1jAUYAA..; path=/; expires=Wed, 21-Aug-2013 01:58:10 GMT; domain=.adnxs.com; HttpOnly
Content-Type: text/xml
Set-COOKIE: anj=Kfu=8fG1aPCxrx)0s]#%2LcYUiWd4r$[-T_g+2'ti*zYQaYhJGno9P8*w:M5Uy0Hg2:=*oU[fy9; path=/; expires=Wed, 21-Aug-2013 01:58:10 GMT; domain=.adnxs.com; HttpOnly
But from this url using firebug you will see there are 4 Set-COOKIEs header response
但是从这个使用firebug的url中,您将看到有4个Set-COOKIEs头响应
Set-COOKIE:icu=ChIItcsCEAoYBSAFKAUwhND1jAUQhND1jAUYBA..; path=/; expires=Wed, 21-Aug-2013 00:51:16 GMT; domain=.adnxs.com; HttpOnly
Set-COOKIE:anj=Kfu=8fG1aPDYS3+0s]#%2LcYUiWd4r$[-T_g+2'thuA$jWEA)yIwtO#ou!>8<=/=PpF>B2sEM:U9)Egw$gpKtsw['ZH`CLcww-vV^ufhcR)XmgkjKre#dUU5QfVO.L4fG9GFBu=Gz$A>!A#UF?AH^u[OpI#n[aDEPs:sNe8^J#UAxP$yFLD=::tzzS/UTdX!C/=v7)6Fp'>c:%:rUn#/mTw`N#7U9(rwFXkmv^qM'0_QMX_jew(sDj(>a@s0XLV(Y%hCGZ`WDyVH>**Uy08b!:1hy:3!?k; path=/; expires=Wed, 21-Aug-2013 00:51:16 GMT; domain=.adnxs.com; HttpOnly
Set-COOKIE:uuid2=3617392369395966810; path=/; expires=Wed, 21-Aug-2013 00:51:16 GMT; domain=.adnxs.com; HttpOnly
Set-COOKIE:sess=1; path=/; expires=Fri, 24-May-2013 00:51:16 GMT; domain=.adnxs.com; HttpOnly
I'm missing the most important COOKIE which is the Set-COOKIE: uuid2. Is there something wrong with my code on how I curl the url or maybe I'm missing some curl parameter?
最重要的COOKIE是uuid2。我的代码是如何卷起url的,或者我遗漏了一些curl参数,这有什么问题吗?
2 个解决方案