WebBrowser w/ CookieCollection

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • andrewschools
    New Member
    • Dec 2007
    • 3

    #1

    WebBrowser w/ CookieCollection

    Hi,

    I was wondering, can you send a CookieCollectio n to a System.Windows. Forms.WebBrowse r? If so, how would I go about doing this. What I've done so far is send a POST request to a login form using HttpWebRequest. Now I want to send that CookieCollectio n to the System.Windows. Forms.WebBrowse r so the user can see the protected page...

    Thanks,
    Andrew
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Originally posted by andrewschools
    Hi,

    I was wondering, can you send a CookieCollectio n to a System.Windows. Forms.WebBrowse r? If so, how would I go about doing this. What I've done so far is send a POST request to a login form using HttpWebRequest. Now I want to send that CookieCollectio n to the System.Windows. Forms.WebBrowse r so the user can see the protected page...

    Thanks,
    Andrew
    It sounds like you are attempting to use Forums Authentication.
    You should research this method of authentication to see how you can set authorization rights on specific restricted pages to particular individuals...

    If you're using Visual Studio 2005/2008, Forums Authentication is made easy using Roles and Membership....c heck out this great online video tutorial for a quick demonstration on how this is easily done.

    Cheers!
    -Frinny

    Comment

    • andrewschools
      New Member
      • Dec 2007
      • 3

      #3
      Originally posted by Frinavale
      It sounds like you are attempting to use Forums Authentication.
      You should research this method of authentication to see how you can set authorization rights on specific restricted pages to particular individuals...

      If you're using Visual Studio 2005/2008, Forums Authentication is made easy using Roles and Membership....c heck out this great online video tutorial for a quick demonstration on how this is easily done.

      Cheers!
      -Frinny
      Hi Frinny,

      Thanks for the info. Also, I did the following which solved my problem...

      Code:
      string cookie_string = "";
      foreach (Cookie cook in cookies)
      {
      
      cookie_string += cook.ToString() + ";";
      
      }
      
      this.webBrowser1.Document.Cookie = cookie_string;
      Thanks,
      Andrew

      Comment

      Working...