retrieve cookie using curl, and set that cookie to user

josephdiloy

New Member
I access the page with this code. Then it gets the cookie,This is my curl code:\[code\]$ckfile = tempnam ("/tmp", "CURLCOOKIE"); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_USERAGENT,"Mozilla/3.0 (compatible; MSIE 5.01; Windows NT 5.0)"); curl_setopt($ch, CURLOPT_HTTPHEADER, array("REMOTE_ADDR: ".$_SERVER['REMOTE_ADDR'], "HTTP_X_FORWARDED_FOR: ".$_SERVER['REMOTE_ADDR'])); curl_setopt($ch, CURLOPT_COOKIEJAR, $ckfile); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec ($ch);\[/code\]I want to set the information stored in the ckfile to the user.How can I do that?
 
Back
Top