3

I've a VF page that is storing value of a checkbox option. I don't want this option to be a persistent value like in CustomSetting or somewhere as a record. I just want to maintain the value as a custom cache stored value in a cookie.

In desktop browser mode it is working fine, but in Salesforce1, my page works fine with all functions working right, but when I leave the custom vf tab and go to other tab and then come back to my vf tab, it restores the checkbox value to what it was originally.

p.s. - I'm saving the checkbox value to a cookie on checkbox change event.

2

Reading a bit about this topic, I would advise to use a custom setting after all to store user's preferences in Salesforce1. If you just have 1 record per user with all different fields (one per preference), that wouldn't take too much of data storage anyway.

An advantage of it would also be that in case they change one of these preferences, they would be saved and available cross platform. So independent if your user would access the Salesforce1 mobile app or if they would access your page through the regular Salesforce UI.

Also I wouldn't really trust the use of cookies on mobile browsers / devices. Maybe, the cookie you set gets lost because under the hood it would re-open a browser every time? (just a thought) Have a look at this article http://blog.personagraph.com/cookies-in-mobile/ maybe this will shed more light.

But again, my suggestion would go to the direction of custom settings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.