Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

PHP 

Help about Php curl get cookies

I'm trying use curl for login hulu.com and im use "preg_match_all('/^Set-Cookie:\s*([^;]*)/mi', $result, $matches);" for get cookies response

How can i get value cookie "bm_sv
value : 0AB7970228D4EDB3987C522EE182FE…MzpzebJKOyV4Qt9t54sLVSCfsVQ==" ,response of curl only show "_tcv" and "_h_csrf_id". Can i get solution for this case ?
Don’t. Use curl cookie jar
i dont use cookies jar my friend .Here is my curl :

"curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_USERAGENT, random_uagent());
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
$result = curl_exec($ch);
preg_match_all('/^Set-Cookie:\s/mi', $result, $matches);"

Only response _tcv and _h_csrf_id ,no see bm_sv value cookie :(
(Oct 22, 2019 12:46 AM)linhtinh Wrote:  i dont use cookies jar my friend .Here is my curl :

"curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
       curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
       curl_setopt($ch, CURLOPT_USERAGENT, random_uagent());
       curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
       curl_setopt($ch, CURLOPT_HEADER, 1);
       $result = curl_exec($ch);
      preg_match_all('/^Set-Cookie:\s/mi', $result, $matches);"

Only response _tcv and _h_csrf_id ,no see bm_sv value cookie :(
No.
USE COOKIE JAR. It’s made fo campuses it all. You’re making it way harder than it has to be
(Oct 23, 2019 09:19 AM)Charger Wrote:  No.
USE COOKIE JAR. It’s made fo campuses it all. You’re making it way harder than it has to be

I think what OP needs to understand, it's that COOKIE_JAR is a curl option.
How about that https://hotsource.dev/2019/04/29/php-cur...-sessions/
[Image: vibesignature.gif]


“Whatever Your Mind Can Conceive and Believe, It Can Achieve.” – Napoleon Hill
(Oct 23, 2019 02:48 PM)newQuery Wrote:  I think what OP needs to understand, it's that COOKIE_JAR is a curl option.
How about that https://hotsource.dev/2019/04/29/php-cur...-sessions/

He needs to do anything but try to capture it with Regex. That ain’t gonna work well.


Nachfolger come take a look


Possibly Related Threads...
Thread / Author Replies Views Last Post
[PHP] by barimoAug 6, 2021 01:01 AM 4 214 Aug 6, 2021 01:01 AM
Last Post: barimo
[PHP] by Programmer00Jan 30, 2020 05:57 AM 1 152 Jan 30, 2020 05:57 AM
Last Post: Charger
[PHP] by redmoon90211Jan 16, 2020 11:42 AM 11 290 Jan 16, 2020 11:42 AM
Last Post: Charger