Cookie in weview SDK 30
Navraj Singh
1
Reputation point
In Xamarin Android SDK 30, when trying to set webview cookie does not work.
string cookieString = string.Format("{0}={1}; path=/;domain={2}; secure; ", Strings.SessionCookie, encryptedCookie, "value");
if (Android.OS.Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop)
{
CookieManager.Instance.SetAcceptThirdPartyCookies(webView, true);
}
else
{
CookieManager.Instance.SetAcceptCookie(true); //this function doesn't work from lollipop(API21) and above
}
CookieManager.Instance.SetCookie(RootCookieDomain, cookieString);
webView.Settings.JavaScriptEnabled = true;
webView.Settings.DomStorageEnabled = true;
webView.LoadUrl(ConsentManagementLink);
Sign in to answer