I'm trying to authenticate a client to my secure WebSocket server (wss) for registered member area.
Once a member is connected to the web server, I record, in a database, a unique token (associated to the member) that I displayed in a hidden field on the page initiating the connection to the Web Socket server.
Then the token is sent to the WebSocket server that authenticates the account using the token.
I'm really not a security expert, and I wanted your opinion as to the security of my authentication.
Are there any risks (except cookie hijacking)? Are there any better way to proceed considering that WebSocket doesn't prescribe any particular way that servers can authenticate clients during the WebSocket handshake.
I use Ratchet WebSocket.