.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

Only allow 2 Logins per UserAccount

Posted By:      Posted Date: August 27, 2010    Points: 0   Category :ASP.Net

Hi there...

I am sitting with a senario where the client wants a User account only to be logged-on a maximum of 2 concurrent sessions. I am just putting this out to please ask the pro's what ways there are to do this?

I know that one way is to write the Userinfo into a database table ie. UserName,IpAddress and some other usefull info but then when it comes to the time when the user just closes the browser then how am i going to update the database table?

What is the advantages of using your preferred method and what is the cons.


View Complete Post

More Related Resource Links

Prevent Concurrent Logins ? [ Already logged in or currest session is still active implementation] ?


Hi Experts ,

I searched over the web but no luck so far and thought of getting some help form gurus .

Did any out really implemented a way to handle concurrent logins ?

Please not that i'm no using either forms authentication or Roles/Memberships , I do have custom authentication for my website .

I'm sure it is someway related  with global.asax file handling something in application events and session events but unable to figure this one out .

Any pointers will highly be valued and appreciated .

Thanks a tonne in advance .

Need to allow user to view all logins on SQL Server

SQL Server 2005/2008. By default, on SQL Server any user can see only his login or NT Groups, which he belongs to (both through Security\Logins in SSMS and sys.server_princapals DMV). I need to permit one power user to see all SQL Server logins. But only see, not change. Can you help me? P.S. VIEW ANY DEFINITION helps, but this permissions are too much.

ASP.NET 5.0: Multiple logins and login types in default ASP.NET membership provider

What do you think about an ability of having multiple logins and login types to be attached to the same user? Let me explain this by showing how database schema can be re-factored to support this model:Remove [Password], [PasswordSalt] columns from [Users] database tableAdd [Logins] table with one-to-many relationship between [Users] and [Logins] tablesThis will allow one user to have multiple credentials attached to his or her account of different types such as Username&Password, Windows Live ID, Open ID from different providersYou will be able to restrict allowed login types and OpenID providers in web.config So.. do you think it is a good idea to add support of this model into ASP.NET 4.5/5.0 membership service?http://aspnet.codeplex.com/workitem/7149

preven multiple logins on same account

Hi, i'm using ASP.NET membership for a silverlight application that makes use of Wcf Ria Services. my problem is that i don't want multiple logins on the same account and i need to logout the user when he logs in on another machine. (I don't want the account to be used by many people at the same time, and the last who logs in must kick out everyone else)   is this possible?  

SQL Server Security > Logins vs. Databases > Security > Users

Why isn't all security needs done just in logins?  When migrating databases, the Logins are not brought over when restoring a backup.  It does not make sense.  Could it not be done all just in the Security > Logins area or why not?  That COULD be designed to track users and rights on various databases rather than a thing owned by each database....Thanks for your time.Gib

AspNetActiveDirectoryMembershipProvider & mixed logins

Hi All,I'm creating a WPF application, for which all users must be authenticated to an Active Directory.- Clientside, i'm using Client Application Services.- Server-side, i have an asp.net web application with a AspNetActiveDirectoryMembershipProvider.All is working as expected.There's one catch however.Some of the wpf application users log in with their windows in to the domain, others don't.So for the users which are logged in to the domain (group A), I do not want to ask for their username/password at application startup.The other users (group B) of course have to supply their Active Directory Username/password at application startup.This group B just perform Membership.ValidateUser(userName, password), ending up in the AspNetActiveDirectoryMembershipProvider and be authenticated.However, how can I check for group A that they have been succesfully authenticated to the AspNetActiveDirectoryMembershipProvider, without havingto ask their username/password?Thanks,Koen

Error 15401 when adding AD logins in upper case to a sql 2008 server

We are repeatedly getting Error 15401 when adding couple AD logins in upper case(DOMAIN_NM\USR_NM) to a sql 2008 server with the latin1_general, binary sort collation.  Lower case (DOMAIN_NM\usr_nm) works fine.  All the other servers, even the ones with the same collation, it is the opposite, upper case works and not the lower case.  Looked for duplicate SIDs in the domain, on the sql server, did not find any.  Any idea what's going on?. 

how to override the default popups for windows logins for guest users?


how to override the default  popup for windows logins for guest users?

So that guests will be provided with restricted access?


Are nested Windows groups supported as SQL Server 2008 logins?


I am attempting to configure a new SQL Server 2008 instance to use Windows authentication, and am encountering a problem when adding Windows domain groups as logins. Specifically, Windows users who are direct members of a Windows group that has been added as a login behave normally. Users who are members of groups that are, in turn, members of other groups which have been added as logins are unable to connect.

In a simplified example, consider the following:

Group: MYDOMAIN\DataViewers
  Member: MYDOMAIN\Hazel
  Member: MYDOMAIN\Seamus

Group: MYDOMAIN\DataEditors
  Member: MYDOMAIN\Vaughan
  Member: MYDOMAIN\Liesel

Group: MYDOMAIN\AllUsers
  Member: MYDOMAIN\DataViewers <-- This is a group
  Member: MYDOMAIN\DataEditors <-- This is a group

If I add the MYDOMAIN\AllUsers group as a SQL Server login (and map it to some databases), none of the end users (i.e. Hazel, Seamus, Vaughan, Liesel) can connect. If I add the MYDOMAIN\DataViewers or MYDOMAIN\DataEditors groups as logins, though, their members can connect. Similarly, if I add an end user directly to the AllUsers group, they can connect normally.

It appears as if the nested group model I had envisioned is not supported in SQL Server 2008, but I have been unable to find any documents that state this conclusively. Therefore, my q

How to avoid (Preventing) Multiple Logins in ASP.NET


i need a help

for  avoid (Preventing) Multiple Logins in ASP.NET

GoDaddy.Com is a negligent parent, so can somebody help this newbie set up admin/user logins?


I'm becoming increasing frustrated with the lack of support at GoDaddy.Com.  Today they're not even answering their phones!

All I'm trying to do is set up an admin and several user accounts on my site so I and several users can log on. I'm not even trying to do it remotely, but on their SQL server.

1. Using Query Analyzer I created a few users:

INSERT INTO aspnet_Users(ApplicationID,  UserName, LoweredUserName,  LastActivityDate).... That worked.

2. Next, I created a couple of roles:

INSERT INTO aspnet_Roles(ApplicationID, RoleName, LoweredRoleName).... That worked.

3. I then put the users in these roles:

INSERT INTO aspnet_UsersInRoles(UserID, RoleID)....  That, too, worked.

4. But then I tried to put those users, roles, and UsersInRoles into aspnet_Membership according to their own documentation--Activating ASP.NET 2.0 Personal Web Site User Account  http://help.godaddy.com/topic/216/article/885 using  UPDATE aspnet_Membership SET IsApproved = 1 WHERE UserId = 'MyUserId'

Nothing.  Although Query Analyzer tells me the command executed successfully, the aspnet_Membership table shows no entries.

It's my understanding that getting entries into this table is critical for the login procedure. So can somebod

Tracing the logins and users


Hi  Team,


2 days back i have created logins and users in one instance 


how can i trace those logins and users are working fine or not plz advise me.




MySites Authentication Best Practices - Eliminate redundant logins?


Greetings all,

Our users have started to adopt the new MySites, which is great! For the first time, we're getting questions like: "How do I add my photo into MySites" and "How do I build my professional network" or "Wow, the ask me about is a great feature!". These are most definitely wins for Microsoft (and their team's hard work).

However, we're also getting some questions, one of which has to do with why people are required to log in 1-2 extra times as they pass from our Intranet portal to their Mysite.

Theoretically, shouldn't the AD/login authentication information be passed directly through to the MySite? What can we do to make the transition from corporate intranet to mysite more seamless, e.g., not require an extra 1-2 logins?

Several notes w/ information:
(1) The Intranet and MySites resides on the same server, but (of course) are different site collections
(2) We're using standard authentication (not Kerberos)
(3) Both servers are on ssl - but that shouldn't make a difference, should it?

Thanks so much!


Odd Logins / Users Problem



  • I have 2 different databases on the same server supporting two different websites through SOAP endpoints.
  • I have 2 different logins with Windows credentials, one for each database.
  • We had problems and had to change the passwords for the two Windows accounts.
  • One of the web sites came right up after entering the new password in the site, the other is still giving us problems.
  • Both SQL Logins are public server role and dd_datareader, dd_datawriter & public database roles.
  • One login / user will execute all the stored procs in the database using exec ('...') as login = '...' under the above roles.
  • For the other login / user I have to either grant explicit execute privileges to each stored proc or make the user db_owner.
  • We have opened the user and login properties for both accounts side by side and compared every item on every tab and can find no difference beyond the name and the database.

What have I got here?


Preventing Multiple Logins


Hi all,

I'm using the "cache tecnique" to prevent multiple logins. Reading in this forum I have read the following code:


    Protected Sub Application_PreRequestHandlerExecute(ByVal sender As [Object], ByVal e As EventArgs)
        If System.Web.HttpContext.Current.Session IsNot Nothing Then

            If Session("users") IsNot Nothing Then

                ' This is after an initial logon 
                Dim sKey As String = CType(Session("users"), String)
                ' Accessing the Cache Item extends the Sliding Expiration automatically 
                Dim sUser As String = CType(HttpContext.Current.Cache(sKey), String)

        End If

    End Sub


                '  Multiple Logins check
                Dim sKey As String = txtUsername.Text + txtPassword.Text
                Dim sUser As String = Convert.ToString(Cache(sKey))
                If (sUser Is Nothing) OrElse (sUser = String.Empty) Then

                    ' Login Permitted
                    Dim SessTimeOut As New TimeSpan(0, 0, HttpContext.Current.Session.Time

how many logins we can create on sql server database

how many logins we can create on sql server database.please tell  me maximum number of logins in sql server.2000,2005 and 2008.

How to check logins for password_policy ?


Hi All,

I'm trying to develop a simple script that checks all the logins on SQL, grabs only those with 'password policy' checked, and then looks at when the password was last set, and calculates when it will expire.

Is there a system table/view that i can look at to find out all the SQL logins who have the 'password policy' property checked?

I know i can use this function in SQL 2008 R2-



ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend