At the moment anyone can enter a chat...but it does give notifications as to who's entered the chat (and who leaves, but only in IE as mozilla browsers don't support window.onunload).
I still have a bit of work to do, but it works
But you can see all my source...that's pretty much it. One giant AJAX() function that handles the reloading of the div, and posting of new messages. I decided to check for new messages every 2 seconds...it's fast enough.
And my bandwidth has not increased at all...and I haven't noticed any lag on my site or anything. But then again, not many people use my site...but still, when you think about it, since it's only fetching new messages, that's only a maximum of like, 2 or 3 each request (every 2 seconds).
And yeah, if you leave the chat and come back, all the old messages will be gone...unless you delete your cookie with the id of the last message in, which will force it to show the whole chat.
And thanks. Yeah, I wrote the entire site myself.
Good luck

Feel free to use my source as a starting point.If you get stuckon anything in particular I'd be happy to help.
Edit:
Oh, and to answer your question about loading all messages...well, loading a large chat (say with around 200 messages or so) every 2 seconds would probably be a bit strenuous on the server...especially if a lot of people are in the same chat, so it would have to load the whole chat, every two seconds, for every person. So potentially thousands of rows every two seconds for each request would definitely be a lot slower than just loading new messages, which would be inthe tens.
Also, I originally did this myself, but I had a problem of scrolling the div to the bottom, to show the new messages. Because it would reload the div every time, the div would scroll up and down every two seconds. Honestly, loading new messages is the only way to go tbh...
