cordova-android
cordova-android copied to clipboard
AndroidInsecureFileModeEnabled prefrence not working
Bug Report
Problem
After Cordova 10 release Cordova added WebViewAssetLoader support which can cause data associated with the file://
scheme, such as cookies, local storage, local cache, and web-based databases
But if we set AndroidInsecureFileModeEnabled to true according to docs(https://cordova.apache.org/announcements/2021/07/20/cordova-android-10.0.0.html) it will work like earlier which is not working for me
Due to this I am facing cookies issue
What is expected to happen?
After setting AndroidInsecureFileModeEnabled preference to true in config.xml it should work like old one
Information
Command or Code
<preference name="AndroidInsecureFileModeEnabled" value="true" />
Environment, Platform, Device
Version information
Checklist
- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above
Same issue, How to fixed this?
This ticket does not give enough Information.
At best, I can only recommend upgrading to the latest [email protected]
and try again.
cordova platform rm android
cordova platform add android@latest
If you still have the issue after upgrading, try and provide more Information.
For example, provide the information that comes from the network & application tab of the DevTools and make sure its from both the working and non-working app. Both should show that the index.html
is loading from file:///android_asset/www/index.html
... Application tab should also show that it is reading from file://
for the cookies, etc. If you see it checking file://
but there are no cookies, it probably means Android wiped out the information for more space.
Make sure to also test with 10.1.0
as it might have fixed that area.
This ticket does not give enough Information.
At best, I can only recommend upgrading to the latest
[email protected]
and try again.cordova platform rm android cordova platform add android@latest
If you still have the issue after upgrading, try and provide more Information.
For example, provide the information that comes from the network & application tab of the DevTools and make sure its from both the working and non-working app. Both should show that the
index.html
is loading fromfile:///android_asset/www/index.html
... Application tab should also show that it is reading fromfile://
for the cookies, etc. If you see it checkingfile://
but there are no cookies, it probably means Android wiped out the information for more space.Make sure to also test with
10.1.0
as it might have fixed that area.
Thanks. [email protected] It's works fine for me.
@pawan-logiciel At your earliest convenience, If you could confirm that updating to [email protected] solves your issue for us so we can determine if this issue can be closed or not.
Cheers, Norman
@breautek @erisu It's still not working for me.
I've just tried it out and it seems to be working as expected (for me).
@breautek FYI - I am facing this issue only in android 11 for other versions it's working fine and the issue is not with AndroidInsecureFileModeEnabled it's and cookie issue in my app HTTPS URL (AWS scdn URL) not working it gives 403
Is it possible that the server is setting a restrictive SameSite
policy?
Closing as can't reproduce since the setting is working fine for everybody except from the reporter and by the last message the setting seems to be working, but there are cookie problems, which seems related to some server configuration problem, but there was no response to the last question.
Note that the setting, as the name says, is insecure, because google marked it as insecure and might eventually break in future Android versions, so we don't recommend using it and if things stop working there we won't fix them (mostly because we probably can't)