Connecting Tech Pros Worldwide Forums | Help | Site Map

Limit # of concurrent logins.

Paul
Guest
 
Posts: n/a
#1: May 5 '06
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.

Erik Funkenbusch
Guest
 
Posts: n/a
#2: May 5 '06

re: Limit # of concurrent logins.


On 4 May 2006 15:52:56 -0700, Paul wrote:
[color=blue]
> 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?[/color]

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.
Paul
Guest
 
Posts: n/a
#3: May 5 '06

re: Limit # of concurrent logins.


> Because the web is asynchronous and stateless, there is no real way to[color=blue]
> 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.
>[/color]

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.

Paul
Guest
 
Posts: n/a
#4: May 5 '06

re: Limit # of concurrent logins.


> Because the web is asynchronous and stateless, there is no real way to[color=blue]
> 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.
>[/color]

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.

Rajesh CKR
Guest
 
Posts: n/a
#5: May 5 '06

re: Limit # of concurrent logins.


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" <paulmartin_nj@yahoo.com> wrote in message
news:1146783176.576123.181360@i40g2000cwc.googlegr oups.com...[color=blue]
>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.
>[/color]

Closed Thread


Similar ASP.NET bytes