Web App: Limiting # of logged in users

  • Thread starter Thread starter Adam
  • Start date Start date
A

Adam

Greetings,

I am creating a web application, which I will be selling licenses to
be able to use it. So Customer Group A, could purchase 3 licenses,
Customer Group B could purchase 30.

With the web app I am using asp.net/vb.net

This means Customer Group A, could only have 3 concurrent users logged
in, and for Customer Group B only 30 at one time.

I am using a username, password, groupID criteria to log in to the
system.

My question is - how do I go about being able to say "ERROR: Customer
Group A already has 3 logged in users - please wait to be able to use
the system".

Obviously, I can't use a literal to store the value at during logon -
because if the person does not click a "log out" button and just
closes the browser, it will not increase the number of available seats
for that group.

I have had ideas with using the global.asax file, with possibly using
the Application_Start/End and/or Session_Start/End in some sort of
combination - but curious to see if anyone out there has any bright
ideas.

Your assistance in anyway would be much appreciated.

-Thanks
 
This is not a bright idea by any stretch of the imagination...you could store the information for the 3 concurrent users in a db table. For example, the users are Jimmie, Sam, and Sally. Let's say Sally logs off. You could have some sort of reaper process running which would check for live sessions. If it's not live, remove Sally's info from the db table. You now have an open spot. The good thing about storing the user info in a db table is you can create an admin app which would view exactly who is online, their info, etc

----- Adam wrote: ----

Greetings

I am creating a web application, which I will be selling licenses t
be able to use it. So Customer Group A, could purchase 3 licenses
Customer Group B could purchase 30

With the web app I am using asp.net/vb.ne

This means Customer Group A, could only have 3 concurrent users logge
in, and for Customer Group B only 30 at one time

I am using a username, password, groupID criteria to log in to th
system

My question is - how do I go about being able to say "ERROR: Custome
Group A already has 3 logged in users - please wait to be able to us
the system"

Obviously, I can't use a literal to store the value at during logon
because if the person does not click a "log out" button and jus
closes the browser, it will not increase the number of available seat
for that group

I have had ideas with using the global.asax file, with possibly usin
the Application_Start/End and/or Session_Start/End in some sort o
combination - but curious to see if anyone out there has any brigh
ideas

Your assistance in anyway would be much appreciated

-Thank
 
From my own hunting around - it seems pretty much nothing short of
JavaScript detecting a browser closing or someone typing a new url in
the address bar, and then redirecting the browser to a .aspx page that
abandons the session will get this to work (which also introduces
browser compatability issues - but I could enforce a certain type of
browser for this product).

I know the session_end will execute upon the session expiring, but I
can't wait 20 minutes for the user slot to clear, nor can I have a 1
minute time out to use the software obviously.

IF there is anything - I mean anything, i.e. creating a server side
dll, some crazy amount of programming - anything - above and beyond
javascript that will let me accomplish this feat - please let me know.
I mean could I have a master window open that has some sort of applet
running talking to the server while the rest of the web app is run?

I am reaching here - but just looking for new ideas and possibilities.

Thanks...
 
Greetings,

From my own hunting around I came to the same conclusion. I am
currently going to store the logged in information in the table - but
please go into more detail of this 'reaper process'.

My big obstacle now is getting the not active users to be removed from
the logged in table in a short amount of time. I can't wait 20
minutes for the seat to open up (i.e. waiting for a session_end event
to fire), nor can I have a 1 minute time out for a web based
application)

So with this 'reaper process' - how about do I go about creating and
checking for active users? Is it a situation where I have some
javascript on my pages causing a reload ever 60 seconds, and having my
time out set two 2 minutes - which doesn't sound very flattering
either.

Please if you can describe this reaper process - as I would love to
hear about it.

Thanks.

WiseOne said:
This is not a bright idea by any stretch of the imagination...you
could store the information for the 3 concurrent users in a db table.
For example, the users are Jimmie, Sam, and Sally. Let's say Sally
logs off. You could have some sort of reaper process running which
would check for live sessions. If it's not live, remove Sally's info
from the db table. You now have an open spot. The good thing about
storing the user info in a db table is you can create an admin app
which would view exactly who is online, their info, etc.
 
Adam said:
Greetings,

I am creating a web application, which I will be selling licenses to
be able to use it. So Customer Group A, could purchase 3 licenses,
Customer Group B could purchase 30.

With the web app I am using asp.net/vb.net

This means Customer Group A, could only have 3 concurrent users logged
in, and for Customer Group B only 30 at one time.

I am using a username, password, groupID criteria to log in to the
system.

My question is - how do I go about being able to say "ERROR: Customer
Group A already has 3 logged in users - please wait to be able to use
the system".

Obviously, I can't use a literal to store the value at during logon -
because if the person does not click a "log out" button and just
closes the browser, it will not increase the number of available seats
for that group.

I have had ideas with using the global.asax file, with possibly using
the Application_Start/End and/or Session_Start/End in some sort of
combination - but curious to see if anyone out there has any bright
ideas.

Your assistance in anyway would be much appreciated.

-Thanks
Possibly that what you need is use a shared or static structure to hold a
count of groups and users. Then when you try to create the Page instance,
you should check. I am thinkin that you should provide the http way of
rejecting a login (403).
I hope this helps
 
Back
Top