Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Required Cookies Not Sent on Android #2392

Open
1 of 2 tasks
njovy opened this issue Nov 4, 2024 · 4 comments
Open
1 of 2 tasks

Required Cookies Not Sent on Android #2392

njovy opened this issue Nov 4, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@njovy
Copy link

njovy commented Nov 4, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I am using this plugin to log in to a third-party service, which relies on cookies to verify if a user is authenticated. While the same code functions correctly with flutter_webview and works without issues on iOS, the inappwebview plugin on Android fails to send the required cookie provided by the server. Due to this, I currently have to use flutter_webview for Android users to log in. I am unsure which specific cookie is missing. I have researched this issue, and although several developers have raised similar concerns, I haven't found a solution. I believe there may be a bug in inappwebview on Android where certain cookies are not being set correctly.

Expected Behavior

The cookie is set correctly.

Steps with code example to reproduce

Don't have code to reproduce yet.

Stacktrace/Logs

NA

Flutter version

v3.24.4

Operating System, Device-specific and/or Tool

SM F721N (mobile) android-arm64 Android 12 (API 32)

Plugin version

v6.1.5

Additional information

No response

Self grab

  • I'm ready to work on this issue!
@njovy njovy added the bug Something isn't working label Nov 4, 2024
@njovy njovy changed the title Required Cookies Not Sent Required Cookies Not Sent on Android Nov 4, 2024
@pichillilorenzo
Copy link
Owner

Could you try the new version 6.2.0-beta.1?

@njovy
Copy link
Author

njovy commented Nov 7, 2024

@pichillilorenzo Unfortunately, updating to 6.2.0-beta.1 didn’t resolve the issue I'm experiencing. I’m temporarily using flutter_webview on Android and continuing with this plugin on iOS until this issue is resolved. I’ll provide further details later to help identify the cause.

@njovy
Copy link
Author

njovy commented Nov 7, 2024

@pichillilorenzo, I opened chrome://inspect, debugged a request by copying it as cURL, and noticed that a few headers were missing. This request is initiated by JavaScript, and for the same request on the same site, the cookie header appears with flutter_webview, but inappwebview does not set the cookie when the request is sent.

@pichillilorenzo
Copy link
Owner

Maybe this could be caused by the shouldOverrideUrlLoading event.
Please, post your current InAppWebView implementation with all the InAppWebViewSettings you are using.
Also, try a way to share steps and possible code to reproduce the issue, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants