KyranRana / cloudflare-bypass

A new and improved PHP library which bypasses the Cloudflare IUAM page using cURL
MIT License
275 stars 97 forks source link

not woking with cookies #142

Closed Sarfroz closed 4 years ago

Sarfroz commented 4 years ago

i tried to pass custom cookies using

$cookie='PHPSESSID=eonnrm4uqrocrrd7n3lp3lgl84; userdata=a%253A8%253A%257Bs%253A7%253A%2522u;';

curl_setopt($ch, CURLOPT_COOKIE, $cookie);

but it keeps loading. I just want to know that if I have a logged cookie of a website how can i pass it along with Cloudflare cookies.

Vmadmax commented 4 years ago

@Sarfroz How did you get it to work?

fullsharez commented 4 years ago

look at the rights of the folder and don't forget to put the full path of the file location

Vmadmax commented 4 years ago

look at the rights of the folder and don't forget to put the full path of the file location

Huh, that was fast! Thanks.

The cookie is saved correct in the cookie file

curl_setopt($ch, CURLOPT_COOKIEJAR, dirname(__FILE__) . '/cookie.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, dirname(__FILE__) . '/cookie.txt');

But in the second request

CURLOPT_COOKIEFILE, dirname(__FILE__) . '/cookie.txt',

It isn't working. The login page appears. It's not correct?

fullsharez commented 4 years ago

I don't know at all the CURLOPT_COOKIEJAR it is to keep the CURLOPT_COOKIEFILE up to date it is to make the cookie