userfrosting / UserFrosting

Modern PHP user login and management framework
https://www.userfrosting.com
Other
1.63k stars 368 forks source link

Information stored on local storage #1103

Open jackyhosg opened 4 years ago

jackyhosg commented 4 years ago

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?

alexweissman commented 3 years ago

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

Silic0nS0ldier commented 3 years ago

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

alexweissman commented 3 years ago

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

Silic0nS0ldier commented 3 years ago

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