jaymoulin/guzzlehttp-cloudflare

Is it possible to reuse cookies for next request

Closed this issue · 6 comments

If my guess is right, the current situation is a new cookies generated when a request made. Once the request ends, the cookies file delete.

Is it possible to reuse the cookies?

For example, I need to get a token from login page and post it along with username and password, that means I need to make a least two request. When I get proper token and post, it returns 503 error.

Thanks and best regards!

Or any example code will be very helpful.

Made some tests myself with the same cookie but wasn't able to bypass cloudflare without getting a new one. Let me know if you can find a solution so I merge your PR / implement.

Do you mind giving an example so I can understand why you NEED to do that?

Jaymoulin,

Thank you for your promote reply and test.

I need to fetch some data from a page that need to login. For both login and CloudFlare-bypassing purpose, the cookies required.

In current situation, when I fetch a token from login page, and then post it along with username and password, it returns a CloudFlare 503 page(it should returns the requested website page instead of Cloudflare 503 page).

I published a new version that should handle cookies so that you could log to your site. It regenerates a token cookie but it should work. let me know

@jaymoulin

This version works fine! Thank you soooo much!

Just a small problem:
Undefined index: verbose_mode in ./vendor/kyranrana/cloudflare-bypass/src/CloudflareBypass/CFBypasser.php on line 126

I guess this verbose_mode is undefined, are you gonna fix it in your code, or just let users to do the define?