iphone - How do I convert an NSHttpCookie to a System.Net.Cookie in MonoTouch? -
i have monotouch iphone app federated sign in via azure access control service. login done via embedded uiwebview browser. when login done, want transfer cookie app. have access the
nshttpcookiestorage.sharedstorage.cookies
collection, can find cookie. in order call end services, need have a
system.net.cookie
that can put cookiecontainer send service.
how convert between two... way?
nshttpcookie cookie = nshttpcookiestorage.sharedstorage.cookies[0]; system.net.cookie newcookie = new system.net.cookie() { name = cookie.name, value = cookie.value, version = (int) cookie.version, expires = cookie.expiresdate, domain = cookie.domain, path = cookie.path, port = cookie.portlist[0].tostring(), // correct?? secure = cookie.issecure, httponly = cookie.ishttponly };
yes, how convert. perhaps should make extension method on nshttpcookie? call like:
var c = cookie.toclrcookie ();
Comments
Post a Comment