I am writing chat program and don't know how to store names of the users. When I store it in to session.name it has the same value in every browser I run. Is it possible to do that without using database ?
This is how I do it:
var MemoryStore = express.session.MemoryStore,
sessionStore = new MemoryStore();
and then I just store value:
sessionStore.nickname=nickname
now I run browser fill nickname and send it to server. Then open another browser and it already has that value - - I need different values for each of them.
I'm uncertain from the question (even the edited version) if you're modifying the sessionStore or the session. The above code indicates you're modifying the sessionStore, which should be the same for all requests. To add values to an individual session, assuming you are also using Express, you need to modify the HTTP request's session variable. In Express 2.x this is done with request.session.nickname = nickname;.