PDA

View Full Version : Set a variable in session



deepakgarg89
14 Nov 2012, 12:24 AM
Hi,

Suppose i have a variable xyz = 5, i want to set it in session in sencha touch 2. Can anyone please tell me how can i set it in session, please provide me a get method also.

Thanks

themightychris
14 Nov 2012, 7:51 AM
You don't need Sencha's help, LocalStorage (http://diveintohtml5.info/storage.html) is available on all the browsers Sencha Touch supports.

Just do:


localStorage.setItem('xyz', 5);
alert(localStorage.getItem('xyz'));

deepakgarg89
14 Nov 2012, 7:47 PM
Thanks for the reply... I was just confused in setting a parameter.