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
{{ message }}
Repository navigation
ionic for android device $cookies does not work! #5873
Thanks for opening an issue with us, we just need a little more info from you so that we can better help you with your issue. What version of Android are you testing on? Also would you be able to provide a plunkr, codepen or repo that we could use to repro the issue on our devices?
@jgw96 the version of my emulation is 4.4.4 and my device is also 4.4.4! the code is very simple. i use ngCookies module and use method $cookies.putObject("key",{id:1}) and $cookies.getObject("key"). But $cookies.getObject("key") return null on android. it is right on ios and browser.
@gluttonman After doing some testing of my own on a Nexus 7 running Android 6.0.1, a Nexus 6 running the Android N dev preview and a Moto X 2014 running 5.1 ngCookies does appear to have some issues on android in Cordova apps that i will need to look further into. Is there a specific reason that you are using cookies and not something like localStorage?
Hello! Thanks for opening an issue with us! Since it has been a little while since there was any activity on this issue i will be closing it, but feel free to respond back if your still having the issue! Thanks again!
Hi, I also got this problem when I try to use $cookies on android version 5.1+, it's not working.
When I run it on the browser (with ionic serve) it's working but on android it isn't.
Do you have any ideas ?
Tnx!
@chen1203 it is because that chrome broswer not support cookies that load local file. the app fix on device is like the broswer load local file, so the cookies is disable.
Activity
jgw96 commentedon Mar 18, 2016
Thanks for opening an issue with us, we just need a little more info from you so that we can better help you with your issue. What version of Android are you testing on? Also would you be able to provide a plunkr, codepen or repo that we could use to repro the issue on our devices?
gluttonman commentedon Mar 19, 2016
@jgw96 the version of my emulation is 4.4.4 and my device is also 4.4.4! the code is very simple. i use ngCookies module and use method $cookies.putObject("key",{id:1}) and $cookies.getObject("key"). But $cookies.getObject("key") return null on android. it is right on ios and browser.
jgw96 commentedon Mar 21, 2016
@gluttonman After doing some testing of my own on a Nexus 7 running Android 6.0.1, a Nexus 6 running the Android N dev preview and a Moto X 2014 running 5.1 ngCookies does appear to have some issues on android in Cordova apps that i will need to look further into. Is there a specific reason that you are using cookies and not something like localStorage?
jgw96 commentedon Mar 30, 2016
Hello! Thanks for opening an issue with us! Since it has been a little while since there was any activity on this issue i will be closing it, but feel free to respond back if your still having the issue! Thanks again!
gluttonman commentedon Apr 1, 2016
@jgw96 Thank you for help me! the cookies can store data by expire date but localStorage can not do it . so i choose to use cookies.
chen1203 commentedon May 14, 2016
Hi, I also got this problem when I try to use $cookies on android version 5.1+, it's not working.
When I run it on the browser (with ionic serve) it's working but on android it isn't.
Do you have any ideas ?
Tnx!
gluttonman commentedon May 18, 2016
@chen1203 it is because that chrome broswer not support cookies that load local file. the app fix on device is like the broswer load local file, so the cookies is disable.
chen1203 commentedon May 20, 2016
@gluttonman - So what is the solution ? What is the best/recommended way to store some data when the app is close? (for example - to login)
chen1203 commentedon May 20, 2016
I used localStorage and it works both on browser and android.
@gluttonman - thanks.