I need an idea

  • Thread starter Thread starter Mr Seth T
  • Start date Start date
M

Mr Seth T

I am supposed to implement a web app in C#/.NET and it needs to be
installed on the customer's server and ran from anywhere. The problem
is this software needs to be licensed by user (i.e. they buy 2
licenses, only 2 sessions should be open at a time). I can currently
see how many sessions are active, but I need a way to tighten this up
where when they close their browser it frees up a session and it also
can run long queries so it would be nice that as long as the window is
open the session remains active. I know it can be done but I don't
have a clue how. (I think that's how myspace does it) Any suggestions
would be great

Thanks,
-Seth
 
I think your best bet is to allow a third session to be opened at any time but it invalidates the oldest open session,
i.e. session 3 ends session 1.

mnichols
 
I didn't even know sessions could terminate each other. I forgot to
add that this doesn't have to be done with sessions, it can be using
our database or whatever else someone could think of, and the number of
allowed users will need to be changed if the customer buys more
licenses.

Thanks again,
-Seth
 
- Ending a session when a user closes a browser window is simply not a realistic option too much can go wrong, the web is stateless, etc.
- It isn't so much that one Session would end another. It's more that a session would consider itself valid or invalid based on another value.
- That value would be a list of Session Ids in either the Application[] array or a DB - your choice.
- Each Session would have a last access timestamp associated with it.
- When a user starts a new session invalidate the least recently used SessionId
- When a request comes in with an invalidated SessionId redirect it to a SessionEnded or Logon page

mnichols
 
I am at a point now where I need to work on this, and I still don't
have a good idea of how I am going to do it. -->mnichols idea--> I
don't think I can close open sessions at all, I need the sessions to
stay open, and close out anyone who would try to open a new one that is
out of the licensed amount.

I have an idea of shortening the session timeout to around 2 min. and
have my master page run JavaScript that would ping the server every 30
secs so that I just use the built in session management, have the
master page keep track of how many open session there are, and if a
session is accidentally lost, the user would only wait a max of 2 min.
The problem with that is the pining. I don't know how obtrusive/ that
would be to the application to have JavaScript ping every 30 secs. I
would like some insight on what someone thinks about that to.

-Again, thx for any help
Seth
- Ending a session when a user closes a browser window is simply not a realistic option too much can go wrong, the web is stateless, etc.
- It isn't so much that one Session would end another. It's more that a session would consider itself valid or invalid based on another value.
- That value would be a list of Session Ids in either the Application[] array or a DB - your choice.
- Each Session would have a last access timestamp associated with it.
- When a user starts a new session invalidate the least recently used SessionId
- When a request comes in with an invalidated SessionId redirect it to a SessionEnded or Logon page

mnichols

I didn't even know sessions could terminate each other. I forgot to
add that this doesn't have to be done with sessions, it can be using
our database or whatever else someone could think of, and the number of
allowed users will need to be changed if the customer buys more
licenses.

Thanks again,
-Seth
 
Back
Top