guillaumepotier / Garlic.js

Automatically persist your forms' text and select field values locally, until the form is submitted.
http://garlicjs.org/
Other
2.36k stars 176 forks source link

Option (and data-attribute) to use sessionStorage #115

Open soullivaneuh opened 6 years ago

soullivaneuh commented 6 years ago

https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage

In a nutshell, the sessionStorage is the same as the localStorage but limited to the session.

It looks more appropriate for form under secure application with user login.

Can an option be added to use sessionStorage instead of localStorage?

guillaumepotier commented 6 years ago

Sure, we worked on a project named basil that allows us to abstract the underlying storage and have an unified API to store things. It might be interesting to couple that project with this one to allow where we store the info.

Feel free submit a PR :)

Best

soullivaneuh commented 3 years ago

@guillaumepotier That could be a nice idea, however I don't have enough time to work on this right now.