Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript - using sessionStorage vs variables

I have an Ext-JS(Sencha) mobile application. After a user logs in, i load some data from the server in which I store in variables for the users session. I was wondering if it was better to use sessionStorage vs putting these into variables, or if it even made a difference. (The data is sometimes pretty large, but it's not static enough to put into localStorage).

Are there any advantages to using sessionStorage, from a performance standpoint, over in-memory variables ?

Thanks

like image 486
29er Avatar asked Feb 14 '12 15:02

29er


1 Answers

I would say the advantage is that session storage will go across page loads. If the data is not going to outlast a page load just use variables.

like image 147
Jeff Avatar answered Sep 20 '22 14:09

Jeff