Solved

checking if a user is already logged into asp site

Posted on 2007-11-19
5
903 Views
Last Modified: 2013-12-17
Is it possible to check if a user is already logged into an asp site ... i.e. as a user is entering their username/password and submitting -- to then check to see if they are logged in already (perhaps on a different pc) -- then log off the existing session (blocking access via previous login status) and then allow the new user to log in etc.

how do I check and action this type of transaction please?

your time and efforts with this enquiry are much apprieated.
0
Comment
Question by:amillyard
  • 2
  • 2
5 Comments
 
LVL 96

Assisted Solution

by:Bob Learned
Bob Learned earned 400 total points
ID: 20312327
Are you using Forms authentication?  Are you storing a cookie on the machine for the authenticated user?

Bob
0
 

Author Comment

by:amillyard
ID: 20313333
TheLearnedOne:

aspx forms that is -- using login.aspx / combined with login controls.  not aware of using cookies as using db connection for authentication.  asp creates a template db for sql 2005.

have not used any cookies yet on any web-page, as normally try to avoid storing local data, 1.security, 2. less browser issues, 3. centrally managed user data (allowing mobile users and more consistant information share)
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 400 total points
ID: 20313688
You can persist the state of user logins with Forms authentication using cookies:

Explained: Forms Authentication in ASP.NET 2.0
http://msdn2.microsoft.com/en-us/library/aa480476.aspx

See "Forms Authentication Cookies" section.

Bob
0
 
LVL 1

Assisted Solution

by:arshadd
arshadd earned 100 total points
ID: 20333252
I think you should have a user's table where you should be storing User Id Password add a field logged and IP in when the user logged in set this field to true and srore the IP. and if you want to expire the already logged in user just signout him.
0
 

Author Comment

by:amillyard
ID: 20333405
arshadd:

yes, understood.

what about if someone gets 'logged out' by asp because of inactivity or when the browser is close via the top-right 'x' and or closes unexpectedly (like a crash) -- how would this table be updated...this could potentially mean that someone could never logged back in if table not updated.

how would I capture those other updated events of inactiivty and unexpected browser closes.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

948 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now