0

我正在使用 jquerycookie插件来保存数据,数据已保存并且我可以读取它但是当我关闭浏览器并再次打开它时它就会消失,我为 进行编程Samsung smart TV app,并且 api 支持 cookie,也正如我所说的我可以读取数据抛出cookie,我将到期日期设置为100天,但是当我关闭电视并再次打开它时没有数据,电视使用Mozilla,这是我的代码。

 jQuery.cookie("user", data, { expires: 100 });

虽然数据是来自ajax调用的json对象,但我将其解析为字符串并保存它,当我读取它时它工作正常,但问题是当我关闭电视并再次打开它时没有保存数据。

4

1 回答 1

0

Maybe you should use sf.core.localData("user", data); instead of cookies. Just see guide.

Then you have to emulate expiration on your own - maybe save timestamp in your data and then compare it with current timestamp when TV/app is starting. If data expired, just do what you need.

As far as I know the common area mentioned in guide is the only way to store persistent data.

于 2012-11-27T08:13:08.067 回答