I've created a websocket avatar chat application where a user is given an avatar and they can move around with this avatar and send messages.
I want to design a login which connects to my database (already has several accounts stored). When a user has logged in with the correct details, I'd like for their username to be shown on a chatlog i.e. "Damien has logged in". Of course there'd be several more features I'd be able to finally work on when I implement the login with the application but I'm not sure how I can.
I'm presuming it will involve adding perhaps a user array list in the room? The websocket server is created in python, client in html5 and javascript.
Any suggestions?
Cookie is available with websocket. Just login and store a session/cookie for the user as normal. The you will know who it is.
Or, just send the cookie as the first message after connecting.
Creating login for a websocket application?