Reputation: 3356
I'm trying to Log into a website using WebRequests
in C#
But the website is using Google-Analytics libraries which is making some UTM-Cookies
The question is how can I catch those cookies values and pass them to the website?
Upvotes: 0
Views: 592
Reputation: 9837
The HttpWebRequest
class has a CookieContainer
collection property that you can add instances of the Cookie
class.
The HttpWebResponse
class has a Cookies
collection property that contains instances of the Cookie
class.
Make your request, read the cookies from the response, and add them to any subsequent requests as needed.
Upvotes: 1