When a player connects to the server, it does not show the html welcome message for the first time, but if it connects to the server again, it is fine.
This problem is probably in lines 108 and 236.
The value of "user" is always null on the first connection to the server.