simonlast / node-persist

Super-easy persistent data structures in Node.js
MIT License
719 stars 78 forks source link

Question: stored keys are shared across users? #110

Open venkatkonjeti opened 6 years ago

venkatkonjeti commented 6 years ago

I am using node-persist module in my application to store the tokens.

setItemSync("userResourceToken", "someToken...")

As per understanding this token will be shared across multiple sessions. Is that right?

If above question is true, then to separate the token for every user should I store the user specific token with unique key? In this case server storage is an option or should I choose the any db for this purpose?

akhoury commented 6 years ago

you need to use unique keys per user if you want to do that.

setItemSync("userResourceToken-" + userId, "someToken...")