I'm looking to add on info to this post
Node.js (mysql+socket.io) Authentication PHP via Cookie?
If possible please explain this part and if scenario is correct based on assumptions in above question:
Lets say I have user login via ajax, upon success, I return the session ID to the client side with ajax response, and send it to a websocket request. There on node.js, I keep an array of the successful login session ID's, and can get the member_id using the session ID. This way I don't have to make the session ID accessible via javascript (leaving cookie http only). Lastly, when I visit another page, I have to use ajax to resend the session ID to websockets to reinitiate the websocket chat.
Is my understanding correct? The safety is my concern, I don't know what monstrous issues could occur if I have an ajax response with the session_id. Or is there a way to bypass this sending? I've read about something called Redis, would this be running while I apache, node.js and mysql running? So I have 2 databases running at same time instead of just one?
Edit: Already see someone trying to close the question. Let me rephrase it then, returning the session ID via an ajax response poses a threat or not..?