void IAuthenticator.ClearAllCookies() { CookieManager cookieManager = CookieManager.Instance; cookieManager.RemoveAllCookie(); cookieManager.Flush(); }
void IMsAuthenticator.ClearAllCookies(string authority) { var authContext = new AuthenticationContext(authority); Task.Factory.StartNew(() => { authContext.TokenCache.Clear(); }).Wait(); CookieManager cookieManager = CookieManager.Instance; cookieManager.RemoveAllCookie(); cookieManager.Flush(); }
private async Task <string> OnSetCookieRequestAsync(Cookie cookie) { if (Control != null && Element != null) { var url = new Uri(Control.Url).Host; if (Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.LollipopMr1) { CookieManager.Instance.SetCookie(url, cookie.ToString()); CookieManager.Instance.Flush(); } else { CookieSyncManager cookieSyncMngr = CookieSyncManager.CreateInstance(Context); cookieSyncMngr.StartSync(); CookieManager cookieManager = CookieManager.Instance; cookieManager.SetCookie(url, cookie.ToString()); cookieManager.Flush(); } } var toReturn = await OnGetCookieRequestAsync(cookie.Name); return(toReturn); }