Preventing concurrent logins - Classic ASP

Discussion in 'ASP General' started by BenM, Jan 27, 2005.

  1. BenM

    BenM Guest

    Description:
    I would like to prevent a user from logging in with their user/password
    combination on a different computer or even a different browser window, if
    they are already logged in. I have a login page, from which I use a DB check
    to verify user/password info. Also, I have a bit loggedIN field in the DB,
    which I use to see if they are currently logged in; if so, I prevent them
    from logging in a second time.

    Problem:
    Unless they click the "Log Out" button, then the DB value does not get
    changed. Any suggestions as to how I can log them out, even if they simply
    close the browser window or jump to a different page?

    Thanks in advance!
     
    BenM, Jan 27, 2005
    #1
    1. Advertising

  2. BenM

    Mark Schupp Guest

    1. Put a timestamp in the database and update it with every page hit. Then
    you can have the login "time out"

    2. At login time, give the user the option to cancel the pre-existing
    session if one exists. You'll need to keep a unique "logged on" identifier
    instead of a simple flag to block the previous session if an attempt is made
    to re-use it.

    --
    Mark Schupp
    Head of Development
    Integrity eLearning
    www.ielearning.com


    "BenM" <> wrote in message
    news:...
    > Description:
    > I would like to prevent a user from logging in with their user/password
    > combination on a different computer or even a different browser window, if
    > they are already logged in. I have a login page, from which I use a DB

    check
    > to verify user/password info. Also, I have a bit loggedIN field in the

    DB,
    > which I use to see if they are currently logged in; if so, I prevent them
    > from logging in a second time.
    >
    > Problem:
    > Unless they click the "Log Out" button, then the DB value does not get
    > changed. Any suggestions as to how I can log them out, even if they

    simply
    > close the browser window or jump to a different page?
    >
    > Thanks in advance!
     
    Mark Schupp, Jan 27, 2005
    #2
    1. Advertising

  3. BenM

    Guest

    BenM wrote:
    > Description:
    > I would like to prevent a user from logging in with their

    user/password
    > combination on a different computer or even a different browser

    window, if
    > they are already logged in. I have a login page, from which I use a

    DB check
    > to verify user/password info. Also, I have a bit loggedIN field in

    the DB,
    > which I use to see if they are currently logged in; if so, I prevent

    them
    > from logging in a second time.
    >
    > Problem:
    > Unless they click the "Log Out" button, then the DB value does not

    get
    > changed. Any suggestions as to how I can log them out, even if they

    simply
    > close the browser window or jump to a different page?


    Here's what I do: I have a table that contains the user ID,
    application ID (which is just an identifier to the different apps we
    have) an session ID.

    Then the user logs in, those fields are populated. Every time a page
    loads we have a toolbar that is included on each page. That page then
    checks the current session ID against the database. IF it doesn't
    match, I send them to a page which says "You can only be logged into
    the application in one browser at a time"... or something like that.

    So what ends up happening is that whatever browser session logs in
    last, that's the valid session. That way someone could leave their
    desk, go to another workstation, and still be able to log into their
    account.
     
    , Jan 28, 2005
    #3
    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. Replies:
    2
    Views:
    700
    amjathrahman
    Jul 20, 2006
  2. Sameer

    preventing multiple logins

    Sameer, Oct 20, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    412
    Sameer
    Oct 20, 2003
  3. The Crow

    Preventing Multiple Logins

    The Crow, May 24, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    530
    John Timney \(ASP.NET MVP\)
    May 24, 2005
  4. Paul

    Limit # of concurrent logins.

    Paul, May 4, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    697
    Rajesh CKR
    May 5, 2006
  5. HinaAsp.Net
    Replies:
    0
    Views:
    949
    HinaAsp.Net
    May 12, 2011
Loading...

Share This Page