Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 16, 2013 05:17 PM by Xequence
Feb 13, 2013 04:58 PM|LINK
Is it possible to know how many concurrent times a user has logged in? We are developing a web application in which we want to limit the number of concurrent times a user is able to login.
Feb 14, 2013 02:52 AM|LINK
use Application state..
Feb 15, 2013 12:17 PM|LINK
You can do something like this. Call the below code when the user log in
int maxLimit = 5;
if (Membership.GetUser("Username here").IsOnline)
if (Application["Username here"] == null)
Application["Username here"] = 0;
int times = int.Parse(Application["Username here"].ToString());
Application["Username here"] = times++;
if (int.Parse(Application["Username here"].ToString()) == maxLimit)
//cancel the login
And when the user logs out, decrease the Application variable value by 1.
Please 'Mark as Answer' if this post helps you.
Feb 16, 2013 05:17 PM|LINK
sounds like an ntier application. abstract it out into a small database/table/csv/txt and post your data.