
Untitled
By: a guest on
Jun 30th, 2012 | syntax:
None | size: 0.63 KB | hits: 19 | expires: Never
How do I convert an NSHttpCookie to a System.Net.Cookie in MonoTouch?
NSHttpCookieStorage.SharedStorage.Cookies
System.Net.Cookie
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(), // is this correct??
Secure = cookie.IsSecure,
HttpOnly = cookie.IsHttpOnly
};
var c = cookie.ToCLRCookie ();