UserFrosting icon indicating copy to clipboard operation
UserFrosting copied to clipboard

Information stored on local storage

Open jackyhosg opened this issue 4 years ago • 4 comments

This function read the table search filters from the local storage of file: https://github.com/userfrosting/UserFrosting/blob/master/app/sprinkles/core/assets/userfrosting/js/uf-table.js

Screen Shot 2020-07-14 at 11 19 03 AM

Can we store information using sessionStorage API instead of localStorage?

jackyhosg avatar Jul 14 '20 03:07 jackyhosg

What's the use case for this? To have users' settings follow them around in different devices?

alexweissman avatar Dec 01 '20 21:12 alexweissman

localStorage would persist across sessions (and potentially browsers). sessionStorage gets cleared as soon as the last tab on the owning site is closed.

Relevant doc: https://mottie.github.io/tablesorter/docs/#function-storage

Silic0nS0ldier avatar Dec 02 '20 09:12 Silic0nS0ldier

Ah, didn't see that. So is this setting already exposed through ufTable then?

alexweissman avatar Dec 03 '20 15:12 alexweissman

Not that I can tell. Config object goes into param 4 and we pass in 2 params at most. https://github.com/userfrosting/UserFrosting/blob/master/app/sprinkles/core/assets/userfrosting/js/uf-table.js#L407

Silic0nS0ldier avatar Dec 05 '20 04:12 Silic0nS0ldier