I
I
Ilya Beloborodov2021-04-20 15:48:15
XSS
Ilya Beloborodov, 2021-04-20 15:48:15

Is it ok to store a user's email in localStorage?

There is an idea to remember the user's email:

There is an authorization form, if the visitor has successfully logged in, I save his email in localStorage.
The next time, when I visit a page with a login form, I insert his soap into the corresponding input (so that he does not remember for a long time which soap he used during registration, in case he did not save it in the browser).

What are the risks of this decision?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Sanych, 2021-04-20
@kowap

There is only one risk - if you have third-party scripts on your site and they scour localStorage, then they will borrow all the contents of the localstorage to themselves

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question