Thanks rnd me. I am starting to think that my approach is wrong. I have to know first what storage system to use. But it all looks a bit insecure.
I'll ask about storage systems elsewhere.
I think this js issue is (partly) solved by using the variables outside of the function(s).
The difference between genius and stupidity is that genius has its limits. (Albert Einstein)