Cookies: Are they handled by HttpWebRequest and HttpWebResponse classes?

  • Thread starter Thread starter Ulrich Sprick
  • Start date Start date
U

Ulrich Sprick

Hi all,

I am beginnig to try out the exciting Web stuff in .NET, so please forgive
my perhaps silly question.
I am trying to communicate with a Web server using HttpWebRequest
and -Response classes from a WinForms application. The server may set and
read back cookies.

Do I have to support the server in a special way (like a browser), and if
so, where do I have to look for some documentation? Or are cookies handled
transparently?

Thanks in advance,
ulrich
 
You'll need to create an instance of the CookieContainer class and
attach the container to the Cookie property before sending each
request. The CookieContainer will manage the cookies for you then.
 
Umm.... I must have had my dark sunglasses on while browsing though MSDN
last night, I simply overlooked the CookieContainer property. Sorry for
that. I am looking in the right direction, am I?

Ulrich
 
Back
Top