0

I am searching for a cookie option for Webclient class on windows phone , please tell me if its possible or not

http://msdn.microsoft.com/en-us/library/windowsphone/develop/System.Net.WebClient(v=vs.105).aspx

and why this is not working? 'Add not found ' i need a working sample

 wb.Headers.Add(HttpRequestHeader.Cookie, "somecookie");

        wb.Headers[HttpRequestHeader.Cookie] =  "somecookie";

http://msdn.microsoft.com/en-us/library/windowsphone/develop/0hb8kfxw(v=vs.105).aspx

user3529738
  • 83
  • 1
  • 9
  • wb.Headers.Add(HttpRequestHeader.Cookie, "somecookie"); 'add' not found, i have tried – user3529738 Apr 19 '14 at 11:36
  • Shouldn't you use the CookieContainer of the HttpWebRequest? http://msdn.microsoft.com/en-us/library/windowsphone/develop/system.net.httpwebrequest.cookiecontainer(v=vs.105).aspx – rene Apr 19 '14 at 11:52
  • yes, right but how??? wb.Headers[HttpRequestHeader.Cookie] = "somecookie"; ??? – user3529738 Apr 19 '14 at 11:54

1 Answers1

2

You can use the CookieContainer class. There is a detailed page on msdn here:

How to get and set cookies for Windows Phone 8

George Chondrompilas
  • 3,167
  • 27
  • 35