I'm trying to create an multi-user and multi-permission system that uses socket.io
in order to make a lot of the features real-time and fluid.
I have everything setup and functionally working on page load, querying databases and pulling through relevant data based on the user, their permissions and what groups they're a part of however how would I go about assigning this user a socket, that retains this 'user info' such as their used id along with other things you'd commonly find within session data?
From what I can see, the socket ID resets and changes whenever a page is loaded, refreshed or closed so I can't store this ID in the database temporarily against the user to query against - I'm a little stuck on the best way / practice to go about this.
Edit: I should mention that my application is already built and fully functional aside from the socket side of things using Express.