Hi,
In this condition you can go for two solutions:
1) You can maintain the user in application state. Refer these links:
Beginners Introduction to State Management Techniques in ASP.NET[
^]
http://docs.oracle.com/cd/E14571_01/web.1111/b31974/bcstatemgmt.htm[
^]
These links will give you the basic ideas only. just store the list of online user's and check from that list wether the user is online or not. If the user is already online then avoid show a error message.
2)The second option is to maintain an indicator in database table with 0 and 1. When user is not online make that indicator is 0 and vice versa. and check with that endicator that user is online or not. on click of log out make the indicator 0 and also after session timeout you'll have to make the indicator 0.
This will help you.
All the best.
--AK