I'm implementing a session-based services using expressjs and express-session with the redis-connect store in nodejs and I have a problem with the concurrent modifications on session storage. Find following an example of the problem:
- Two routes published: /api/op1 and /api/op2
- /api/op1: Increment the value of request.session.op1Calls and performs calls to external services (3 seconds)
- /api/op2: Increment the value of request.session.op2Calls and just do nothing (0.1 ms to be executed)
The problem here is: If I execute the op2 several times during the execution of op1, the request.session.op2Calls value is just lost. How should I implement the session store to never lose the values?
Thanks!