Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 234
  • Last Modified:

How do i use asp.net forms authentication and make sure that each user is able to login ONLY once?

I'm writing an appliocation in ASP.NET c# and i have a problem. i'm using the Forms Authentication provided by asp.net and the user list is in the web.config file, i want to make sure that a user can login ONLY once and if he does login the second time (lets say from a diffrent computer though it could be from the same) that application will signOut the old user and login the new one...
if someone can help! i'll be very happy!
0
TCDooM
Asked:
TCDooM
  • 2
  • 2
1 Solution
 
jimmackCommented:
I can't answer the question (since I do JSP development not .NET), but I do have a suggestion.

Obviously, it depends on the purpose of your application, but (for security/site integrity purposes) wouldn't it be better to either:

a) prevent the second login
b) warn one or both users that a second login has occurred (or been requested)
c) at least log the event for audit purposes.

In a Servlet/JSP system, you would use a ServletContext (or application level attribute) to check this, or have a flag in a database indicating when a user is logged in.

Just some stuff to think about ;-)
0
 
TCDooMAuthor Commented:
sure, i know all that stuff, what i was thinking about was a way to do this without writiing the whole code for it! i know how to write an application object that will handle the logins in the system, BUT i was thinking mybe there is a built in way to do it with the .NET forms.
thanks anyway.
0
 
jimmackCommented:
I doubt it :-(
0
 
TCDooMAuthor Commented:
it seems kind of elementry, doesn't it?
i think that the functionality is even implemented in windows 2k, maybe the solution will come from there...
0
 
ericsDevCommented:
I think this is what you may be looking for :)

http://www.eggheadcafe.com/articles/20030416.asp
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now