I have been doing some research on this and I couldn't find a straight answer.
Are there some cookies stored in the container that I can't get to using the Response.Cookies collection? How are cookies handled between requests using these objects? Are some cookies stored in the container but not others?
Judging by the tags you've used on this question, it looks like you're getting confused.
CookieContainer
and CookieCollection
are used with HttpWebRequest
which is when your program is a HTTP client. CookieCollection
stores cookies associated with a single domain name. CookieContainer
stored all the cookies over all the domain names.
In ASP.NET, HttpRequest.Cookies
is HttpCookieCollection
and is used when your program is a HTTP server. It stores the cookies sent by the client to the server. Because there is only one domain name (i.e. yours) there is no need for a 2-dimensional collection.
The two sets of classes (CookieContainer
and CookieCollection
vs HttpCookieCollection
) are totally unrelated with each other.
In this post I've provided some basic background on the cookie collection classes in .NET, but I don't understand your question. What is it you're trying to do?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With