I'm playing around with websockets, so I decided to create a simple chat, to go further in this relatively new technology. After some long programming, (I was already happy about my work) I realised that I had forgotten to implement something very important!
At the moment it works like that: when a user connects to the page he is aked for a nickname. This nickname is stored in a array with it's custom color, and some other nice things, but if the user refreshes the page, obviously, he is asked again for a new nick.
How vould you handle that? Would you create cookies to store the users nickname or would you save the user's IP, or is there any other possibility, any sort of UID that can be used?
(I don't want to use any database at the moment, i would just like to do it as simple as possible)

New Topic/Question
Reply


MultiQuote



|