I made a file encryption app that takes a password to encrypt files. I want to cache the password the user typed in client-side, even after page changes, so that they don’t have to keep typing in their password each time they access the encryption page. What’s the best way to do this?
You should have no problem storing this as a cookie (just like a session cookie from a login). You should additionally encrypt it before setting it as a cookie so that if someone gets hijacked the attacker won't get access to the plaintext password. Also, make sure to set a reasonable expiration on it.