05 Nov

PHP cURL – keep php session during a cUrl request over https

$url =’https://xxx.domain.com/myscrip_with_session_check.php’; $ch = curl_init(); $strCookie = ‘PHPSESSID=’ . $_COOKIE[‘PHPSESSID’] . ‘; path=/’; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_USERAGENT, “Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13”); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // here i add this two lines because i call a script over https with fake ssl certificate curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); […]