You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've encountered a very strange phenomenon. With the same code and the same APK package, there are significant differences in behavior between the emulator with API 28, the emulator with API 34, and the real device (Android 14). In short, the CookieManager.instance().getCookies function fails to retrieve the WebView cookies on the API 28 emulator, but there is no such problem on the API 34 emulator and the real device.
Expected Behavior
The expectation is to be able to obtain cookies through code, just like on a real device.
Steps with code example to reproduce
Steps with code example to reproduce
final iaw.CookieManager cookieManager = iaw.CookieManager.instance();
final cookieJar =CookieJar();
final dio =Dio();
const baseUrl ="";
const cookieDomain ="";
FutureInitDio() async {
dio.interceptors.add(dcm.CookieManager(cookieJar));
awaitUpdateCookie();
}
FutureUpdateCookie({iaw.InAppWebViewController? webController =null}) async {
var cookies =await cookieManager.getCookies(
url: iaw.WebUri(cookieDomain), webViewController: webController);
log("cookies count: ${cookies.length}");
await cookieJar.saveFromResponse(
Uri.parse(cookieDomain),
cookies.map((cookie) {
var c =newCookie(cookie.name, cookie.value);
c.path = cookie.path;
c.domain = cookie.domain;
c.sameSite =SameSite.lax;
c.secure = cookie.isSecure ??true;
c.maxAge = cookie.expiresDate;
c.httpOnly = cookie.isHttpOnly ??false;
log("update cookie: ${cookie.name}");
return c;
}).toList());
}
Stacktrace/Logs
Stacktrace/Logs
cookies count: 0
Flutter version
v3.27.3
Operating System, Device-specific and/or Tool
Android emulator API 28 ❌
Android emulator API 34 ✔
XIaomi Mix Fold 3 Android Version 14 ✔
Plugin version
v6.1.5, v6.2.0-beta.1
Additional information
No response
Self grab
I'm ready to work on this issue!
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Current Behavior
I've encountered a very strange phenomenon. With the same code and the same APK package, there are significant differences in behavior between the emulator with API 28, the emulator with API 34, and the real device (Android 14). In short, the CookieManager.instance().getCookies function fails to retrieve the WebView cookies on the API 28 emulator, but there is no such problem on the API 34 emulator and the real device.
Expected Behavior
The expectation is to be able to obtain cookies through code, just like on a real device.
Steps with code example to reproduce
Steps with code example to reproduce
Stacktrace/Logs
Stacktrace/Logs
Flutter version
v3.27.3
Operating System, Device-specific and/or Tool
Plugin version
v6.1.5, v6.2.0-beta.1
Additional information
No response
Self grab
The text was updated successfully, but these errors were encountered: