【发布时间】:2020-09-18 04:24:25
【问题描述】:
尝试在适用于 iOS 和 Android 的 Xamarin Forms 项目中使用 webview。
在 Android 中,导航到设置 cookie 的网页后,webview 中不会设置任何 cookie。
因此,cookie 不会随后续请求一起发送。
我是否需要做任何事情来启用 webview 的“正常”浏览器 cookie 行为?
目前初始化如下:
vw1.Cookies = New CookieContainer(),其中vw1是WebView的实例
【问题讨论】:
-
你遵循这个设置吗? forums.xamarin.com/discussion/41039/…
-
该线程大约有 5 年的历史并使用 customrenderers。这仍然需要接受 cookie 吗?
-
@AbiSinghal Xamarin.Forms 4.6.0.772 (4.6.0 Service Release 1) 已修复
"Make cookie handling consistent and non destructive (#10571) fixes #10318" (#10571)请参阅此线程:docs.microsoft.com/en-us/xamarin/xamarin-forms/release-notes/… -
我的完整版是4.6.0.800。似乎有一些回归。它在较低版本中运行良好,但由于其他一些问题需要升级。
-
如果你在新版本中仍然存在这个问题,你可以在github页面中打开一个线程:github.com/xamarin/Xamarin.Forms/issues
标签: android xamarin cookies xamarin.forms webview