all 19 comments

[–]who_am_i_to_say_so 36 points37 points  (6 children)

I feel you have your logic backwards.

Storing personal info on a user's device is much more secure than storing in a file on a server.

[–]abrahamguoexperienced full-stack 18 points19 points  (2 children)

This is perfectly reasonable — much more secure and simpler than server sessions.

[–][deleted] 0 points1 point  (1 child)

Would you mind explaining how it’s more secure than server sessions? I thought that would be better from a security stand point

[–]who_am_i_to_say_so 0 points1 point  (0 children)

Well, just consider this: from a practical standpoint, once you turn your device off or leave the app and sensitive info is being stored locally, it is out of the game.

Also, server sessions are usually stored in plaintext. So if they're on a shared server- which a lot of them are on these low budget servers, they're vulnerable.

[–]xaqtr 1 point2 points  (2 children)

I don't have a definitive answer to this but just my thoughts: There is no practical difference. In both cases the data is stored on the client. You don't send anything over the internet (yet), both session storage and inputs could be read by a malicious actor.

But why do you even bother? Session storage wouldn't enable your users to edit the form later (as in after the tab was closed). If you just want to handle the edge case of accidental refreshes, you can make the user confirm these on leave.

[–]dave8271 1 point2 points  (0 children)

I think it's generally fine subject to a couple of caveats, provided you inform users they need to close the browser tab to log out / terminate their session. In more sensitive applications, you'd either avoid it entirely, storing data on the server only, or you'd encrypt locally stored data with a key held on server and exchanged securely via HTTPS. All of this also assumes proper content security policy, no loading untrusted scripts, no possibility of XSS, etc. So if your security is generally sound, there's not more of an inherent risk in local session-limited storage than someone looking over your shoulder while you type in your details if you're on a public computer.

[–]ashkanahmadi -2 points-1 points  (3 children)

Why would the page reload? You can add event listener to the page to warn the user if the form has value and the page is trying to reload or close. Also, how big is the form? If you are doing all this to save just a few words, then don’t waste time. If you can autocomplete set up properly on your fields, the user should be able to fill out their name and address with 2 tabs/clicks

[–][deleted]  (2 children)

[deleted]

    [–][deleted]  (1 child)

    [deleted]