Cookies: Are they handled by HttpWebRequest and HttpWebResponse classes?

Discussion in 'ASP .Net' started by Ulrich Sprick, Oct 7, 2004.

  1. 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
     
    Ulrich Sprick, Oct 7, 2004
    #1
    1. Advertising

  2. Ulrich Sprick

    Scott Allen Guest

    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.

    --
    Scott
    http://www.OdeToCode.com/

    On Thu, 7 Oct 2004 21:52:43 +0200, "Ulrich Sprick"
    <> wrote:

    >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
    >
     
    Scott Allen, Oct 7, 2004
    #2
    1. Advertising

  3. 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
     
    Ulrich Sprick, Oct 7, 2004
    #3
  4. YES! I'm on the way! Thanks for the response!
    ulrich

    "Scott Allen" <bitmask@[nospam].fred.net> schrieb im Newsbeitrag
    news:...
    > 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.
    >
    > --
    > Scott
    > http://www.OdeToCode.com/
     
    Ulrich Sprick, Oct 7, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Satinderpal Singh

    HttpWebResponse/HttpWebRequest problem...

    Satinderpal Singh, Jun 2, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    3,824
    Satinderpal Singh
    Jun 4, 2004
  2. Satinderpal Singh

    problem with HttpWebRequest/HttpWebResponse...

    Satinderpal Singh, Jun 2, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    4,900
    bruce barker
    Jun 2, 2004
  3. Prasanna Padmanabhan

    HttpWebResponse.Cookies

    Prasanna Padmanabhan, May 4, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    6,805
    ChazZeromus
    Jul 23, 2010
  4. _Who
    Replies:
    7
    Views:
    2,686
  5. Ashish, FL

    HttpWebRequest and HttpWebResponse

    Ashish, FL, Oct 29, 2004, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    172
    Ashish, FL
    Nov 2, 2004
Loading...

Share This Page