I'm using Nodejs, Express and MongoDB for creating a web application. For the user registration I assign an ID to each user using a function called by the action (POST) of a form and I assign also a confirmation code (like "123456") for checking the identity of the user into another function called by the confirmation page that appear after the registration page. How can I get the user ID into the other function? (called after pressing submit into another form)
Do I have to use sessions? I think I don't know the right approach to these things
edit: I store the user data into a mongoDB database
redisstore is much more fault tolerant and robust then a global and will help you scale horizontally when ready.