We have an intranet application in which users have to perform authorization to perform certain tasks ... We need to make sure that not a single “application user” is registered more than once at a time.
So what I'm doing right now is that I store the current asp.net session id in the database and then compare each page load if they are the same or not. The session ID is stored in the database when the user logs in.
But, using this type check, database selection is always required. Therefore, I do not really like it. Should there be a more elegant way to solve this, or?
We use ASP.Net2, C # ..
Thanks in advance for any input.
[Update Information]
I have already created a special Memberhipprovider and a custom Memberhippuser. The Membershipuser member has a method called "StartSession (string sessionId)" that is used when the user logs in.
Another CheckSession (string sessionId) method is used for each postback and compares the current session identifier with the session identifier stored in the database.
[Update] Thank you all for your input. Now I will use the cache to prevent permanent access to the database. At first I thought that there is already a class or something that is already dealing with this problem.
source share