Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php curl multiple cookies

I want to use "Rapidshare" api for my website, and I have the problem. My problem is that I have multiple rapidshare premium accounts.I have read the information that if i want to use rapidshare api I must create cookies, without it I can't download,upload... files. Is this a correct information and if it is than how can i use rapidshare api with several premium accounts? can i just create these cookies in different folder and than do something, or handle it without creating cookies with php curl?

like image 902
Volter Avatar asked Dec 16 '22 11:12

Volter


1 Answers

I'm not familiar with rapidshare api, but I suppose it means that cookies are set up client side. If you need to let the server perform the action, you may try this.

curl_setopt($ch, CURLOPT_COOKIE, "CookieName=CookieValue;anotherCookieName=anotherCookieValue");

and add some conditional arguments

if($needToUseAccount1){
   curl_setopt($ch, CURLOPT_COOKIE, "cred1=data1;cred1_b=data1_b");
}else{
   //similar with other accounts
}
like image 130
jabbany Avatar answered Jan 04 '23 01:01

jabbany