By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,081 Members | 862 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,081 IT Pros & Developers. It's quick & easy.

Limit # of concurrent logins.

P: n/a
I have an ASP.NET application that I want to limit # of concurrent
logins. Has anyone done similar things before? I was trying to
increment a counter in the application and decrement the counter in
"Session_End". However, the "Session_End" will only work for InProc
session. So, is there any other approach?

Thanks,
Paul.

May 4 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On 4 May 2006 15:52:56 -0700, Paul wrote:
I have an ASP.NET application that I want to limit # of concurrent
logins. Has anyone done similar things before? I was trying to
increment a counter in the application and decrement the counter in
"Session_End". However, the "Session_End" will only work for InProc
session. So, is there any other approach?


Because the web is asynchronous and stateless, there is no real way to
guarantee whether someone is just idle for a while, or they've closed their
browser. This means that if a user closes their browser accidentally (or
it crashes) and they try to log back in, you will deny them until some
specified timeout happens. Probably not what you had in mind.

One approach is to check whether another session has been started for that
user, and if it has, the dump the current user with an error message. That
may not be ideal, though.
May 4 '06 #2

P: n/a
> Because the web is asynchronous and stateless, there is no real way to
guarantee whether someone is just idle for a while, or they've closed their
browser. This means that if a user closes their browser accidentally (or
it crashes) and they try to log back in, you will deny them until some
specified timeout happens. Probably not what you had in mind.


This could actually be avoid by saving the user's ID or something like
that in application. The real problem I'm having is that if
"Session_End" never got raised if the session was not maintained
through InProc . Then the user will never be out of the system.

May 5 '06 #3

P: n/a
> Because the web is asynchronous and stateless, there is no real way to
guarantee whether someone is just idle for a while, or they've closed their
browser. This means that if a user closes their browser accidentally (or
it crashes) and they try to log back in, you will deny them until some
specified timeout happens. Probably not what you had in mind.


This could actually be avoid by saving the user's ID or something like
that in application. The real problem I'm having is that if
"Session_End" never got raised if the session was not maintained
through InProc . Then the user will never be out of the system.

May 5 '06 #4

P: n/a
I am not sure if this will work for your situation

You could have a last page accessed time for each user and define number of
active users as :

people who have accessed a page in last n minutes...

Raj

"Paul" <pa***********@yahoo.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
I have an ASP.NET application that I want to limit # of concurrent
logins. Has anyone done similar things before? I was trying to
increment a counter in the application and decrement the counter in
"Session_End". However, the "Session_End" will only work for InProc
session. So, is there any other approach?

Thanks,
Paul.


May 5 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.