There's a bug in gmail chat. It does not keep track correctly of logged on users.
When someone enters its gmail account, it will appear as online to others.
If that person closes the browser (not the window, the browser) without signing out from gmail first, it will remain in online state for the rest of this contacts. And from that point on, his state cannot be trusted, even if you logout the contact can appear as online.
I think adding <body onunload="signout"> can solve this.
So if you see online contacts when reading your email and you send messages to them and they do not answer, maybe they're not online :).