fryette / webview_cookie_manager

MIT License
48 stars 52 forks source link

Secure cookies cannot be set on Android 10 #52

Closed rekire closed 3 years ago

rekire commented 3 years ago

I am not really sure why this happens, but I cannot set cookies with the secure flag. Based on https://github.com/googleads/googleads-mobile-flutter/issues/158 this is a general issue. I see in the logcat the same error just with my own domain.

My workaround just for testing is to remove the secure flag, which is very likely a bad idea and can cause serious security issues.

rekire commented 3 years ago

I found a way to make this working. I don't need to set the domain, instead I need to set a origin, but not on the cookie itself. You need to define it on the setCookie method.

cookieManager.setCookies(cookies, origin: 'https://example.net')

This should be documented in a clear way.

fryette commented 3 years ago

@rekire Hey! I'm happy that you found a workaround, would be nice to see your contribution to readme with a link to that issue.