curl-and-php
Re : Secured Cookies
Date: Tue, 13 Jun 2006 13:05:42 +0000 (GMT)
Here is my code:
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($ch, CURLOPT_USERAGENT,$_SERVER['HTTP_USER_AGENT']);
first request that give me the cookies
$adresse="https://www.accessaigvie.com/aigVieExtranetPrivate/LoginCTL/validate";
$postfields="errorURL=home_extranet_public.jsp&login=...&password=...&x=9&y=10";
curl_setopt($ch, CURLOPT_URL,$adresse);
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$postfields);
curl_exec ($ch);
Here is the cookies file
# Netscape HTTP Cookie File
# http://www.netscape.com/newsref/std/cookie_spec.html
# This file was generated by libcurl! Edit at your own risk.
www.accessaigvie.com FALSE / TRUE ... lastknownlogin ...
www.accessaigvie.com FALSE / FALSE ... JSESSIONID ...
And the second request that does not work :
$adresse="http://www.accessaigvie.com/aigVieExtranetPrivate/TarificationServlet/launchCalculs";
$postfields="...";
curl_setopt($ch, CURLOPT_RETURNTRANSFER,0);
curl_setopt($ch, CURLOPT_URL,$adresse);
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$postfields);
curl_exec ($ch);
That second request only send the JSESSIONID but not the other. I don't understand why.
Please help !
thanks
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2006-06-13