Solved

checking if a user is already logged into asp site

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

685 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