This is difficult to implement in HTTP which is a stateless enviromnent.
1.) You can't push a message to the person who is already logged in.
You would either need to have a polling frame on their page that refreshes periodically, looking for a message or implement a socket connection with an applet/flash app or something like that.
2.) Unless you go the
applet route, you have no way of knowing if person one is still online. That person may have logged in and then moved on. The second person would be forced to wait until the first person's session times out. This is usually 30 minutes.