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

Web App: Limiting # of logged in users

P: n/a
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
Jul 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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

Jul 21 '05 #2

P: n/a
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...
ad*********@yahoo.com (Adam) wrote in message news:<51*************************@posting.google.c om>...
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

Jul 21 '05 #3

P: n/a
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" <an*******@discussions.microsoft.com> wrote in message news:<D4**********************************@microso ft.com>...
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.
Jul 21 '05 #4

P: n/a
Adam wrote:
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
Jul 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.