473,387 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Two Users Login with same UserID

A.M
Hi,

I am using WebForms authentication.

What would be the best way to prevent two person login with same userID at
the same time?

Thanks,
Alan
Nov 18 '05 #1
2 1798
"A.M" <no*****@online.nospam> wrote in
news:eL*************@TK2MSFTNGP11.phx.gbl:
What would be the best way to prevent two person login with same
userID at the same time?


Flag the user as "logged in" in the database during Form Authentication.

In the Session_OnEnd event in the global.asax, unflag the user id.

But becareful - sessions last ~20 minutes... so if a user leaves the site
by accident, the user maybe blocked from reaccessing the site for 20+
minutes (depending on your session timeout value).

You could add additional logic to check IP addresses, cookies, etc to make
the flagging more robust and allow a user who did not log out properly to
return and re-login.
--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 18 '05 #2
Hi Alan,

Since you're using the FormsAuthenticaiotn in ASP.NET web application,yes?
Then, as for the prevent mult-login on the same user account , here are
some of my understandings:

1. Generally, such problem need us to manage a lookup table on the
serverside. It contains all he active users who has been login in the web
application. Then, when a user login, if this account hasn't been logged in
the active user table, we do the normal login operation, if exist, we
prevent him from login.

2. Then, the important thing we need to do is capture when a user is login
and when he has been left(logout). , ASP.NET formsauthentication will
generate a authentication token to identify an user who has login, and the
token is be default stored in the clientside cookie. then everytime the
user visit the pages in the web applicaiton, the token will be passed
within the request's cookie collection onto the web server so that the
serverside can check whether the user is authenticated.

So as for your scenario, I think we first need to provide a serverside
lookup table in application's shared memory. Then, we a user first time
login, we add an identity into the table, (need to contain his accountid
and also his sessionid)
Also, in every request's Authentication_Request Event(you can hook it in
Global object or httpModule), we need to check the Formsauthentication
cookie to see whether the user is still active, if the token not exist, we
need to remove the item from the lookup table.

Here are some referece on asp.net Formsauthenticaiotn and asp.net request
processing

#Forms Authentication Provider
http://msdn.microsoft.com/library/en...ookieauthentic
ationprovider.asp?frame=true

#Securely Implement Request Processing, Filtering, and Content Redirection
with HTTP Pipelines in ASP.NET
http://msdn.microsoft.com/msdnmag/is...s/default.aspx

I think they'll also be helpful. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: XP | last post by:
I am having problems with the blow page. I have a login page where I enter the userid and password. This then connects to this page. If I enter the userid and password correctly, it prints...
2
by: Maria | last post by:
Here's what I'm trying to do: I have a web page that's calling the server variable LOGON_USER to retrieve the userid of the person accessing it. The web has anonymous access disabled, and...
1
by: PeteCresswell | last post by:
I'm building an app that isn't exactly Fort Knox security-wise. People who use it fall into three categories: Those that are in a table and have "Edit" permission. Those that are in the same...
2
by: MUHAMAMD SALIM SHAHZAD | last post by:
dear respected gurus, I would like to share ideas...as i learned from you and wish to tell that i had developed the system where i can audit each and every users and their actions(like...
1
by: anonymous | last post by:
Hi all, I've been searching the way to achieve the following task. But no luck so far. I have a web site(main site), which requires authentication. This authentication is set at Windows...
4
by: HNguyen | last post by:
Hi, I have a Web application in ASP.NET. My Application allows the users upload files into the server after checking their user names and passwords. For each transaction, the Web program will...
3
by: bala | last post by:
Hi Gurus The scenario A MS Access frontend application with Oracle Backend (Linked Tables). The Database UserID and password is not stored and each user has a unique UserID and password. There...
1
by: =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= | last post by:
I have that ability to pass userid and password (encrypted) to a coldFusion section of a web site. I'm able to decrypt and run the login and continue through that section of the site. At this time...
13
JodiPhillips
by: JodiPhillips | last post by:
G'day, I have a silly and simple problem that I need some guidance with. Due to the way our network is set up, I am unable to use the group permissions for Access and have had to implement log...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.