restrict user from simultaneously login

 hi

I need to restrict my user i.e., if a user is loged in from a browser he shouldnot be allowed to 

login again from other browser/window until he logs out.

plz do help me to solve this. i am using login control of asp.net for login purpose.

thanx in advance.

 


Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4)
0
sushmithashalini
9/19/2008 10:39:42 AM
asp.net.security 27051 articles. 1 followers. Follow

8 Replies
681 Views

Similar Articles

[PageSpeed] 28

You need to overload OnLoggingIn method of Login control. Then you should to check is Membership.GetUser(username).IsOnline true or false. In case of true - e.Cancel = true;


May the Force be with you
0
nKognito
9/19/2008 12:12:43 PM

Yes, It can be done like this

 

protected void Login1_LoggingIn(object sender, LoginCancelEventArgs e)
    {
        e.Cancel = Membership.GetUser(Login1.UserName).IsOnline;
    }
 Hope it helps!!
.NET-ified
Arpit Khandelwal
Please: Don't forget to click "Mark as Answer" on the post that helped you.
That way future readers will know which post solved your issue.
0
login
9/19/2008 12:22:51 PM

 <asp:Login ID="Login2" runat="server" BackColor="#FFFBD6" BorderColor="#FFDFAD" BorderStyle="Solid"
                BorderWidth="1px" Font-Names="Verdana" Font-Size="10pt"
                ForeColor="#333333" Visible="False" Width="372px" OnLoggedIn="loggin">
                <TitleTextStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                <LoginButtonStyle BackColor="White" BorderColor="#CC9966" BorderStyle="Solid" BorderWidth="1px"
                    Font-Names="Verdana" ForeColor="#990000" />
            </asp:Login>

this is my login control i placed OnLoggedIn="loggin" and in that function i had written this

Dim username As String
        username = Login2.UserName.ToString
        If Membership.GetUser(username).IsOnline = True Then
            Dim ba As String

ba="dosomething"


        End If

for checking purpouse but when i login with my username it is not going in to  this

   If Membership.GetUser(username).IsOnline = True Then
            Dim ba As String

ba="dosomething"


        End If

plz do help me

thanx in advance.

 


Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4)
0
sushmithashalini
9/19/2008 12:26:48 PM

 applied this

e.Cancel = Membership.GetUser(Login2.UserName).IsOnline

but geting syntax error near e.Cancel


Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4)
0
sushmithashalini
9/19/2008 12:28:40 PM

  Public Sub loggin(ByVal sender As Object, ByVal e As System.EventArgs)
        Session("validlogin") = True
        Dim username As String
        username = Login2.UserName.ToString
        e.Cancel = Membership.GetUser(Login2.UserName).IsOnline error here.

        Login2.DestinationPageUrl = "~/mwmenu.htm"
    End Sub


Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4)
0
sushmithashalini
9/19/2008 12:30:42 PM

sushmithashalini:
<asp:Login ID="Login2" runat="server" BackColor="#FFFBD6" BorderColor="#FFDFAD" BorderStyle="Solid"
                BorderWidth="1px" Font-Names="Verdana" Font-Size="10pt"
                ForeColor="#333333" Visible="False" Width="372px" OnLoggedIn="loggin">
                <TitleTextStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                <LoginButtonStyle BackColor="White" BorderColor="#CC9966" BorderStyle="Solid" BorderWidth="1px"
                    Font-Names="Verdana" ForeColor="#990000" />
            </asp:Login>

Do it in OnLoggingIn="Login1_LoggingIn"

like

protected void Login1_LoggingIn(object sender, LoginCancelEventArgs e)

{

e.Cancel =
Membership.GetUser(Login1.UserName).IsOnline;

}


.NET-ified
Arpit Khandelwal
Please: Don't forget to click "Mark as Answer" on the post that helped you.
That way future readers will know which post solved your issue.
0
login
9/19/2008 12:34:18 PM

 hi

can u plz tell me how to overload onLoggedIn method.

Thanx in advance.

sushmitha.


Trust in the Lord and do what is good; dwell in the land and live securely. Take delight in the Lord, and He will give you your heart's desires" (Psalm 37: 3-4)
0
sushmithashalini
9/20/2008 4:49:08 AM

sushmithashalini:
can u plz tell me how to overload onLoggedIn method.

I can not understand why you want to do thi??? The simplest solution lies in OnLoggingIn not, onLoggedIn

 

<asp:Login ID="Login2" runat="server" BackColor="#FFFBD6" BorderColor="#FFDFAD" BorderStyle="Solid"
                BorderWidth="1px" Font-Names="Verdana" Font-Size="10pt"
                ForeColor="#333333" Visible="False" Width="372px" OnLoggedIn="loggin" OnLoggingIn="Login1_LoggingIn">
                <TitleTextStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                <LoginButtonStyle BackColor="White" BorderColor="#CC9966" BorderStyle="Solid" BorderWidth="1px"
                    Font-Names="Verdana" ForeColor="#990000" />
            </asp:Login>
 
protected void Login1_LoggingIn(object sender, LoginCancelEventArgs e)
    {
        e.Cancel = Membership.GetUser(Login1.UserName).IsOnline;
    }
 
.NET-ified
Arpit Khandelwal
Please: Don't forget to click "Mark as Answer" on the post that helped you.
That way future readers will know which post solved your issue.
0
login
9/20/2008 5:47:29 AM
Reply:

Similar Artilces:

Cannot open user default database. Login failed. Login failed for user 'DOMAIN\User'. (.Net SqlClient Data Provider)
Hi when i try and open a database in sql server management studio i get the error "Cannot open user default database. Login failed. Login failed for user 'DOMAIN\User'. (.Net SqlClient Data Provider)", what can i do to rectify this, i have googled around and still havent found no answers. Which authentication mode is your Sql Server configured - MixedMode, Windows Authentication or Sql Server Authentication? Please refer to http://msdn2.microsoft.com/en-us/library/ms366351.aspx and http://blogs.msdn.com/sql_protocols/archive/2006/02/21/536201.aspx    Ple...

Login restriction defeated by simultaneous logins
Please advise if this should be posted elsewhere-- Netware 6.5 sp 8 environment, Win XP, Client 4.91 sp 5, ZfD 7. Students are set with login restriction of 1 concurrent connection. However, if they enter their login name and password on more than one workstation and then hit login simultaneously, both logins succeed. Is there a way to enforce the restriction effectively? Thanks! Chris G -- CarolPhelps ------------------------------------------------------------------------ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The problem is likely that each workstation p...

login security issue
I see 2 boys sitting together that are not supposed to be. When questioned, they said...well...Brandon can't remember his I.D. number so I just let him use my username and password. �If we type it in and hit enter at the exact same time it will log us both in!!!! �I watched them and it worked. Consecutive logins are set at 1. Has anyone seen this.......is there a fix? Netware 6, service pack 3, Windows 98, Novell Client 3.3 >Consecutive logins are set at 1. Concurrent. >Has anyone seen this.......is there a fix? Many many times. Someone reports this he...

Restrict simultaneous logins
Is it possible to restrict the number of times a specifc user login can be used at the same time.  E.g We want to restrict the use of user 'xyz123' to a maximum of 10 logins at any one time.  Alternatively we restrict all users to only one login at a time and create 10 different logins. Regards Roger Graham You can create a database table or use cache object to store the number of active logins by a user. Then validate with this when ever a user logs in. Oops.  This should have been posted in the DotNetNuke forum as we need this facility within the DNN framework.  D...

security restriction for all users
Do I need to create a generic group for all users so that each user can onl= y see bugs in which they have either reported or been assigned? I don't wa= nt our users to see other users bugs. There is no easy way to create group= s, as each user would essentially be his / her own group. Thanks again in advance, Izz ...

Routing unauthenticated users to login page, then onto the intended secure page after login
Ok, in my setup, I made a folder called "Secure" and in the ASP.NET web administration tool via VWD, I added an access rule that denies anonymous users access to aspx files in that folder.  Now, when I directly type in a URL pointing to an aspx file in the "Secure" folder when I'm unauthenticated, the system knows to route me to the login page (I'm using the default membership provider in VWD), and after successful login, to the secure page that was the intended destination.  So I thought all was good.  For reference, here's how it looks li...

Login failed for user 'Bachelorplace'. The user is not associated with a trusted SQL Server connection. (.Net SqlClient Data Provider)
please tellme how to resolve this error, i m using server studio management tool. and trying to connect using sql server authentication. my pc is over a domain.   Login failed for user 'Bachelorplace'. The user is not associated with a trusted SQL Server connection. (.Net SqlClient Data Provider)  check whether that sql server is allowing sqlauthentication or not.select that server -> right click it-> select  properties  -> in the window, select security -> check what is the server authentication. it should be  sqlserver and windows authentica...

Cannot open database "DataBase" requested by the login. The login failed.Login failed for user 'User\ASPNET'.
hi all, i am having my asp.net project and database is in same system. in web.config i diclaire my connection string as <add name="MyWebConString" connectionString="Data Source=AIPL069\SQLEXPRESS;Initial Catalog=MyWeb;Integrated Security=True" providerName="System.Data.SqlClient"/> when i login application i got an error error is Server Error in '/MyWeb' Application. Cannot open database "MyWeb" requested by the login. The login failed.Login failed for user 'AIPL069\ASPNET'. Description: An unhandled exception...

login script provided--User cannnot login as local user the script fails but can login as local admin on xp pc
> Hi all > the error is as follows > novell client scripts has encountered a problem > and needs to close > the exception unknow s/w exception 0xc06d007e > occured in the application at location ox77e738b2 > I have never seen this before and i have tried reinstalling the cleint > but it didnt work. This occurs when the user ins logged into a xp pro pc > as a user though it doesnt occur when logged in as a local admin on the > box. this is only happening on one box. > Login script is below > MAP ERROR OFF BREAK OFF if member of ".every...

how can i implement login & authorization for users and role based application security without using built in contols like CreateUserWizard or login or something else
hi i'm neeraja i'm new to this .net, and i'm implementing application security can anyone help me out that how can i implement login & authorization for users and role based application security without using built in contols like CreateUserWizard or login or something else  Hi,Check out this linkhttp://www.codeproject.com/aspnet/formsroleauth.asp this will guide you to do the role base security .RegardsGanesan S"Hard Work Never Fails"Please "Mark as Answered" if helpful for you....

Restrict login to list of users
Sorry if this has been asked and I missed it... Can I use a Workstation policy package to restrict who can log into a workstation? I want to allow only certain users (or maybe a group) to be able to log into the particular workstation. Thanks! -Farren There is no simple point-click way of doing this. How are users gaining access to the workstation? Domain Logon? Manually Created Local Accounts? ZEN DLU Package? Farren Constable wrote: > Sorry if this has been asked and I missed it... Can I use a Workstation policy package to restrict who can log into a workstation? I w...

Restrict one user Login
I'm developing a website that allows companies to purchase login seats. Does anyone have a way of restricting use of login details such they can only be used by a single user at a time? any links would be greatly appreciated. Also, I am not using Forms Authentication. I would preferably like it using  sql tables.   Concurrency Control in ADO.NEThttp://msdn.microsoft.com/en-us/library/22hhd212.aspx Optimistic Concurrencyhttp://www.asp.net/learn/data-access/tutorial-21-cs.aspx Optimistic Concurrency with the SqlDataSourcehttp://www.asp.net/learn/data-access/tutorial-...

user restricted login form
We have a very simple sales database in MS Access/ASP which previously did not have a login. I added a very simple login code which gives each user their own username and password. The username is the same as their salesname in the database. The database has two tables, tbllogin and tblresults. tblresults holds all the information the sales people need. What I would like to do is restrict the information the user sees by their login. IE, if user CWilliam logs in, CWilliam will only see his information. since the field username from tbllogin = salesnam...

user login with high security
i'm new in asp.net enviroment..so i need someone who can help me!!?..i used to create a simple login page with high security..pls help me k..thanxz a bunch huh!!! You can create the Session variable in the LogIn page ex: LogIn.aspx After you click on the Button to submit the information, It will link to another page such as CheckLogIn.aspx. On Form_Load event you can check the Session variable: ex: If Session("LogIn") is nothing then .... 'Warning... end if...

Web resources about - restrict user from simultaneously login - asp.net.security

Facebook allows advertisers to target broad categories, precise interests simultaneously
Advertisers can now target Facebook users by broad category and precise interests at the same time using the Power Editor tool, according to ...

‘Fortitude’ to Be First Original Show to Premiere Simultaneously Across Sky’s European Network
... 29 to 20 million customers in the U.K., Ireland, Germany, Austria and Italy. The series is the first Sky original program to premiere simultaneously ...

Timely - Scheduling and Time Tracking, Simultaneously on the App Store on iTunes
Get Timely - Scheduling and Time Tracking, Simultaneously on the App Store. See screenshots and ratings, and read customer reviews.

Baby and dog practice new trick simultaneously - YouTube
According to user 'samueljoseph', this Weimaraner will only listen to commands from a deep stern voice. But it looks like this baby is at full ...

Game of Thrones to be broadcast simultaneously around Earth - which means 11am Monday AEST
If ever there was a way to stave off the back-at-work-Monday-blues, surely this is it. Well, it is if you have an understanding boss and Foxtel ...

Game of Thrones to be broadcast simultaneously around Earth - which means 11am Monday AEST
If ever there was a way to stave off the back-at-work-Monday-blues, surely this is it. Well, it is if you have an understanding boss and Foxtel ...

Chinese woman writes with both hands simultaneously - People's Daily Online
SHIJIAZHUANG,Dec.5(Xinhua)AwomanfromnorthChina'sHebeiprovincehasrevealedauniquetal

Why This Analyst Team Sees Cisco and Juniper Both Winning Simultaneously
24/7 Wall St. Why This Analyst Team Sees Cisco and Juniper Both Winning Simultaneously 24/7 Wall St. When one tech giant is given a positive ...

Intel’s upcoming Skylake processors will simultaneously support three 4K monitors at 60Hz
... about Mac , Intel , and 4k continue reading at 9to5Mac . What do you think? Discuss "Intel’s upcoming Skylake processors will simultaneously ...

'Bonnie & Clyde' Miniseries to Run Simultaneously on A&E, History and Lifetime
A&E Networks will run its upcoming "Bonnie & Clyde" miniseries simultaneously on Lifetime, History and A&E later this year, the company plans ...

Resources last updated: 12/10/2015 12:58:53 AM