469,329 Members | 1,428 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,329 developers. It's quick & easy.

How to limit the user only login the system one time at the same t

I want to limit the user only login the system one time at the same time.
I don't want him login the system two with the same user at the same time.

How to do this?
If i have a table to record if this user has logined, this user didn't
logout and just close IE, how do i set his recoed in the table logout?

Thanks,
-Billy
Aug 20 '08 #1
3 3786
Hi Billy,

From your description, I understand you want to prevent users from logining
multiple times(for a specific user account).

As for the login system, are you using Forms Authentication + Membership
service or are you using your own validatiing and authentication service?

Generally, for web application, it use cookie to indicate whether a certain
user has been authenticated(after he has login) in multiple requests to the
same server application(from client). therefore, if one user has login on
one machine and he change to another machine(or system), he may need to
logon again(since the cookie on original system/machine no longer exits).
Are you want to preventing such kind of relogin?

If this is the case, generally, you may need to maintain a table on
server-side(maybe in database or in memory) which mark the status(online or
not) of each user. If a user is marked as online, you will not allow any
more login attemp during that period. Also, such table cannot be 100%
accurate, you need to define an expire span(slide window) that if a user
hasn't visited the server app for that period, you will turn off that
flag(mark it as offline).

the ASP.NET membership use such approach to define the "online users", you
may refer to its implementation if you want to create your own monitoring
system:

#SqlMembershipProvider..::.GetNumberOfUsersOnline Method
http://msdn.microsoft.com/en-us/libr...lmembershippro
vider.getnumberofusersonline.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/...tance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
>From: =?Utf-8?B?QmlsbHkgWmhhbmc=?= <ht****@noemail.noemail>
Subject: How to limit the user only login the system one time at the same t
Date: Tue, 19 Aug 2008 21:59:01 -0700
>I want to limit the user only login the system one time at the same time.
I don't want him login the system two with the same user at the same time.

How to do this?
If i have a table to record if this user has logined, this user didn't
logout and just close IE, how do i set his recoed in the table logout?

Thanks,
-Billy
Aug 20 '08 #2
Hi Billy,

Do you have any further questions on this? If so, please feel free to post
here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.
Aug 22 '08 #3
Your problem is when the user is closing IE without clicking on the
'logout' button.

Add a Global.asax file to your project.

Add the following function to the global.asax file

protected void Session_End(object sender, eventargs e)
{
// Put your code here to change the status in the database
}
Hope this helps you in the right direction

frederik Van Lierde
http://www.SilverSandsAssociates.com
http://BlueBizTalk.blogspot.com
Aug 22 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Gary | last post: by
3 posts views Thread by tchangmian | last post: by
6 posts views Thread by Hannu | last post: by
12 posts views Thread by Michael | last post: by
2 posts views Thread by mark4asp | last post: by
reply views Thread by parun | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.