How to prevent simultaneous login with same user on different pcs
<p>We have a build a intranet application where users have to login to do certain tasks...
We have to make sure that no "application user" is logged in more than once at the same time.</p>

<p>So what I do at the moment is that I store the current asp .net session id in the database and then i compare at every page load wheter they are same or not. The session id is stored in the database when the user logs in.</p>

<p>But by using this kind check, there is always a database select needed. So I don't like this way very much. There must be a more elegant way to solve this, or?</p>

<p>We use ASP .Net2, C#..</p>

<p>Thanks in advance for any input</p>

<p><strong>[Info Update]</strong></p>

<p>I have already created a custom Membershipprovider and a custom Membershippuser.
The Membershipuser has a method called "StartSession(string sessionId)" which is used, when the user logs in.</p>

<p>The other method CheckSession(string sessionId) is used at every postback, and it compares the current session id with the session id stored in the database.</p>

<p><strong>[Update]</strong>
Thanks everybody for your input. I will now use the cache to prevent permanent database access. I first thought that there is already a Class or something that is already handling this problem.</p>
