2 Replies - 784 Views - Last Post: 16 January 2013 - 11:20 PM Rate Topic: -----

#1 b0zhidar  Icon User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 24
  • Joined: 21-December 12

CookieContainer - Replacement or better solution?

Posted 16 January 2013 - 03:02 AM

This problem I had for some time, maybe few months. Using CookieContainer sometimes doesn't work for me. For example, when I try to automatically log into some site which has authToken or something similar in their POST/GET request, it's always failing. So what I am asking today is, is there actually a better solution or replacement for CookieContainer?

Have a nice day,
Bozzy.
Is This A Good Question/Topic? 0
  • +

Replies To: CookieContainer - Replacement or better solution?

#2 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 3575
  • View blog
  • Posts: 11,117
  • Joined: 05-May 12

Re: CookieContainer - Replacement or better solution?

Posted 16 January 2013 - 05:49 AM

Do you know the reason for the failure? Are you sure it is because of the CookieContainer?
Was This Post Helpful? 0
  • +
  • -

#3 b0zhidar  Icon User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 24
  • Joined: 21-December 12

Re: CookieContainer - Replacement or better solution?

Posted 16 January 2013 - 11:20 PM

Well what would be else? I am doing something like this:
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
req.Method="GET";
req.CookieContainer=cc;
HttpWebResponse...
...
Match m = Regex.Match(find the auth token)


And after that do the POST request with the AUTH TOKEN I got from the GET request using CC as CookieContainer too.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1