Solved

checking if a user is already logged into asp site

Posted on 2007-11-19
5
901 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

760 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