Software Archive
Read-only legacy content
17061 Discussions

cache.setCookie does not persist between application start ups.

John_G_3
Beginner
432 Views

I am developing an app. I build the app using 'Crosswalk for Android'.

The app installs and runs as expected. However when I shut the app down and start again any data saved in the cache is lost. As far as I can tell from the documentation the data should persist. I am using:

 intel.xdk.cache.setCookie(key, value, 10);

and

 value = intel.xdk.cache.getCookie(key);

 

 

 

0 Kudos
1 Reply
Brandon_K_Intel
Employee
432 Views

Would you mind explaining the situation some more to help me?

A potential problem is as follows. The documentation states:

For cookies, the intention is that you would use setCookie to save string data in name-value pairs. Cookies persist between application sessions. Data values may be retrieved using the getCookie command or from the getCookieList command as soon as the "intel.xdk.device.ready" event is fired.

Could you be trying to get the cookie from the cache before intel.xdk.device.ready event is fired?

0 Kudos
Reply