http://www.mycircle.freevar.com This is my website. Whenever a user logs in using correct username and password, a field(flag=1) in the database is updated to show that the user is online(for chat). When user logs out, it is set to flag=0 to indicate offline. This works properly.

Consider the situation. The user is logged in(flag=1) and the session is somehow destroyed(may be due to network connectivity). The user is automatically logged out(session destroyed), but the flag field is not updated to flag=0(bcos no script is executed since user doesn't explicitly clicks logout). This means that the user is still online, though he is not!!!

What can i do in this case????

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.