Solved

checking if a user is already logged into asp site

Posted on 2007-11-19
5
907 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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…
The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

738 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