title: Login using WebClient or HttpWebRequest
body: <p>Iam having serious problem with login. I cant use WebBrowser class to login to site because WebBrowser is only single thread class. I cannot login with WebClient because I dont have a cookies. Tried to login with HttpWebRequest and Iam guessing I logged succesfully because i got header with: login.success or something like that, but when I retreived source page it returned me login page showing me that Iam not logged.   </p>
  
  <p>Iam trying to login to this page: <a href="https://lite.betfair.com/Login.do?s=000009z" rel="nofollow">https://lite.betfair.com/Login.do?s=000009z</a> </p>
  
  <p>Url with request: 
  <a href="https://lite.betfair.com/SLoginsubmit.do?s=000009z&amp;secure=true&amp;username=user&amp;password=pass" rel="nofollow">https://lite.betfair.com/SLoginsubmit.do?s=000009z&amp;secure=true&amp;username=user&amp;password=pass</a></p>
  
  <p>Code:</p>
  
  <pre><code>HttpWebRequest request;
  HttpWebResponse response;
  CookieContainer cookies;
  string url = "https://lite.betfair.com/SLoginsubmit.do?s=000009z&amp;secure=true&amp;username=user&amp;password=pass";
  request = (HttpWebRequest)WebRequest.Create(url);
  request.AllowAutoRedirect = false;
  request.CookieContainer = new CookieContainer();
  response = (HttpWebResponse)request.GetResponse();
  cookies = request.CookieContainer;
  response.Close();
  
  request = (HttpWebRequest)WebRequest.Create("https://lite.betfair.com/Events.do?s=000209z");
  request.AllowAutoRedirect = false;
  request.CookieContainer = cookies;
  response = (HttpWebResponse)request.GetResponse(); 
  
  using (Stream s = response.GetResponseStream())
  {
       StreamReader sr = new StreamReader(s);
       string line;
  
       line = sr.ReadToEnd();
  }
  </code></pre>