CURL ile çerezleri kullanarak

0 Cevap php

Ben buna sahip olmayan bir web sitesi için bir "API" yazıyorum.

Temelde, benim PHP kodu sitenize entegre günlükleri ve ben (iki farklı transferlerini) ihtiyaç verilerini alır.

At login time, I'm getting a bit of a problem. The website sets a couple of cookies through HTTP, which I'm capturing using CURL's cookie mechanism. This seems to work out nicely, except that they are also trying to set a cookie via javascript in that same response.

I don't need to parse the javascript since the cookie they set is entirely predictable. What I need is to somehow tell CURL that this cookie exists, WHILE it stills maintains the other cookies.

Yardım? :)


Kıvırmak POST üzerinden giriş bilgilerinizi gönderdikten sonra, ben bu üstbilgileri olsun:

HTTP/1.1 200 OKDate: Fri, 20 Aug 2010 09:39:14 GMT
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 492
Set-Cookie: JSESSIONID=5DE1F32B3668DABB408BBEA10C28DBD5.testmmf1; Path=/merchantlogin
Set-Cookie: loginType=M
Connection: close

Ve bu sayfa içeriği:

<script type="text/javascript">
    var nextyear = new Date();
    nextyear.setFullYear(nextyear.getFullYear() + 1);
    document.cookie = 'login=' + document.referrer + '; expires=' + nextyear.toGMTString();
</script>

Set-Cookie ve document.cookie parçaları edin.

0 Cevap