I’m working on a project that enables users post items they want to sell, the client requested that users be able to chat with other. For example, a user searches for an item, sees the item and sees if the poster of that item is online and clicks chat to initiate a chat session.
-
To track online users, I created a ‘online’ table in my database so that on login, the username is stored in this table and gets deleted on logout. The problem with this is that if the user doesn’t log out but just closes the browser, the username does not get deleted from the ‘online’ table. What is the best way to implement this?
-
How can I implement chat among users so that if a user sees an item he wants to buy and the user is online, he can click ‘chat’ or something like that and a chat window opens like that facebook an only the 2 users chat, and each user can chat with more than one other users at a time.
Any help whatsoever will be greatly appreciated.
1 Answer