Building an HTML server with sessions

Hi.

I have a flow with an http in node and response node where I feed the user x some variables read from a database (like is name, for example) after a login.
I then have a websocket in and out that updates those variables 'on the fly' via javascript.

My question is: if user y enters the same page right after, is he in a different session (like IIS/Apache sessions) or who is the websocket feeding to?

Do I have to create a fake session ID so I can distinguish the users?

Thanks.

Use the sid you returned to the browser after the login to identify your user and create a exclusive channel to your user.

sid (public) -> exchange by server sid, or user id from your db, to fetch user context in the server -> create an exclusive websocket channel with the public sid for that user. You have to verify if the websocket in node allows dynamic routing to retrieve the public sid, and if the websocket out node allows opening and responding to channels dynamically. I never used these nodes, so I dont know.

1 Like

That would probably be a lot easier to do using UIBUILDER. It already has integrated Socket.IO for realtime comms and you can fully control the underlying web server and socket.io if needed.

Socket.IO already provides user isolated comms and UIBUILDER already builds on that. Ideal for session management.

In addition, it also has a synthesised user id which goes further than socket.io's default session id (which changes a little too easily).

1 Like