1 min readOct 1, 2019
That’s a great question. What I did for my project was one-to-one mapping of username with the session id (maybe store it in db or locally in a hashmap). Check initially if the db has an entry of that username, if no create a new session and save sessionId with username as key in db. For subsequent calls for the same username, we would have a value in db for sessionId use that too continue the conversation. For other users it will be the same and a unique sessionId will exist for each user. Hope this helps.