I am currently building an application using node.js and using the socket.io module. When a user connects I am storing data specific to the user against their socket. For example
io.sockets.on('connection', function (socket) {
socket.on('sendmessage', function (data, type) {
socket.variable1 = 'some value';
socket.variable2 = 'Another value';
socket.variable3 = 'Yet another value';
});
});
While this works my question is, is this a good way to do it. I am effectively storing session data but is there a better way to do it?