PHP cURL for Web Scraping: Sessions, Cookies, and Headers

How to handle cookies, CSRF tokens, redirects, and Chrome-matching headers in PHP. Same task in raw cURL and Guzzle side by side