I want to export a CookieContainer to JSON using Newtonsoft.Json but unfortunately CookieContainer hasn\'t an enumerator or stuff, so I can\'t cycle through it ...
<
Use CookieContainer.GetCookies Method
CookieCollection cookies = cookieContainer.GetCookies(new Uri(url));
where url is URL of your site.
In my case, I was not able to use reflection, as suggested in other answers. However, I did know URL of my site to query. I think it is even logical that container does not return all cookies blindly but returns them per URL because cookies always belong to a particular URL and cannot be used outside of context of the domain associated with them.