Limit # of concurrent logins.

Discussion in 'ASP .Net' started by Paul, May 4, 2006.

  1. Paul

    Paul Guest

    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.
    Paul, May 4, 2006
    #1
    1. Advertising

  2. On 4 May 2006 15:52:56 -0700, Paul wrote:

    > 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?


    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.
    Erik Funkenbusch, May 4, 2006
    #2
    1. Advertising

  3. Paul

    Paul Guest

    > 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.
    >


    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, May 5, 2006
    #3
  4. Paul

    Paul Guest

    > 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.
    >


    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, May 5, 2006
    #4
  5. Paul

    Rajesh CKR Guest

    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" <> wrote in message
    news:...
    >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.
    >
    Rajesh CKR, May 5, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pep
    Replies:
    6
    Views:
    809
  2. TroutyJoe
    Replies:
    1
    Views:
    937
    =?Utf-8?B?Y2xpY2tvbg==?=
    Aug 9, 2006
  3. Replies:
    2
    Views:
    881
    Carramba
    Oct 27, 2006
  4. HinaAsp.Net
    Replies:
    0
    Views:
    903
    HinaAsp.Net
    May 12, 2011
  5. BenM
    Replies:
    2
    Views:
    338
Loading...

Share This Page