Cookies: Are they handled by HttpWebRequest and HttpWebResponse classes?

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
 
S

Scott Allen

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.
 
U

Ulrich Sprick

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top