468,249 Members | 1,513 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,249 developers. It's quick & easy.

I need an idea

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

Aug 16 '06 #1
4 1051
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

Mr Seth T wrote:
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
Aug 16 '06 #2
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

mnichols wrote:
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

Mr Seth T wrote:
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
Aug 16 '06 #3
- 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
Mr Seth T wrote:
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

mnichols wrote:
>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

Mr Seth T wrote:
>>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
Aug 16 '06 #4
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

mnichols wrote:
- 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
Mr Seth T wrote:
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

mnichols wrote:
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

Mr Seth T wrote:
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
Aug 22 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Robert Maas, see http://tinyurl.com/uh3t | last post: by
6 posts views Thread by Martijn van Oosterhout | last post: by
7 posts views Thread by elgiei | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by kermitthefrogpy | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.