I am creating a web site in visual studio 2008.
I want to allow the current user to log in but log off any other person logged in under the same username as the current user. (just like like Y!M does when you log in from a different location: It signs you out from the initial location) For managing log in and sign up i am using visual studio createuserwizard and log in cotrol.
Any ideeas ?
After doing some extra research I came up with a solution.
Whenever a user logs in I create a session, say session[“user”] = NewGuid() and I add that same GUID value into a database field for that user. (for example, in the users table I added a new column named session)
Then for every request the user sends to the web page I check whether his session value is the same as the one found in his session datafield in the data base table. If it is not, then it means that somebody else loged in using that username thus creating a new value in the session field in the datatable. In that case I log him out and keep only the last user who logged in.