-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
ionic for android device $cookies does not work! #5873
Comments
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! |
@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. |
Hi, I also got this problem when I try to use $cookies on android version 5.1+, it's not working. |
@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. |
@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) |
I used localStorage and it works both on browser and android. |
description of the problem:
Which Ionic Version? Ionic, v1.2.4 and ngCookies, v1.4.3
The text was updated successfully, but these errors were encountered: