How to stop multiple Log In's under the same Username

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chris Hall

    #1

    How to stop multiple Log In's under the same Username

    Hello,

    Any one got any good ideas or where to look for solutions how to stop
    multiple log ins with the same username? I am using mysql database if that
    makes a difference.

    Cheers

    Chris Hall


  • Gary L. Burnore

    #2
    Re: How to stop multiple Log In's under the same Username

    On Mon, 29 Nov 2004 17:40:34 +0000 (UTC), "Chris Hall"
    <chrish@skwirel .com> wrote:
    [color=blue]
    >Hello,
    >
    >Any one got any good ideas or where to look for solutions how to stop
    >multiple log ins with the same username? I am using mysql database if that
    >makes a difference.[/color]

    You might want to consider the consequences. You'll need to be able
    to support users who aren't really logged in. For example, people
    who's browser or computer crashed mid-session.
    Wbat are you trying to accomplish?

    --
    gburnore@databa six dot com
    ---------------------------------------------------------------------------
    How you look depends on where you go.
    ---------------------------------------------------------------------------
    Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³ÝÛº ݳ޳ºÝ³Ý³Þ³ºÝ³Ý ÝÛ³
    | ÝÛ³ºÝ³Þ³ºÝ³³ÝÛº ݳ޳ºÝ³Ý³Þ³ºÝ³Ý ÝÛ³
    DataBasix | ÝÛ³ºÝ³Þ³ºÝ³³ÝÛº ݳ޳ºÝ³Ý³Þ³ºÝ³Ý ÝÛ³
    | ÝÛ³ 3 4 1 4 2 ݳ޳ 6 9 0 6 9 ÝÛ³
    Black Helicopter Repair Svcs Division | Official Proof of Purchase
    =============== =============== =============== =============== ===============
    Want one? GET one! http://signup.databasix.com
    =============== =============== =============== =============== ===============

    Comment

    • Kelv

      #3
      Re: How to stop multiple Log In's under the same Username

      Chris Hall wrote:
      [color=blue]
      > Any one got any good ideas or where to look for solutions how to stop
      > multiple log ins with the same username? I am using mysql database if that
      > makes a difference.[/color]

      Keep the session id along with ip, login id, and datetime in a sessions
      table.

      You can then check login attempts against the session table, and compare
      the time they logged in against the time now, current IP vs session IP, etc.

      It's not foolproof though you could at least lock out different IPs from
      being on at the same time or within a given timeframe.

      You could also zap the record in the sessions table for the first
      instance of the login, meaning they'd have to log in again. If it's a
      situation where they've shared their login information around, it'll
      teach them not to do it again.

      Kelv :)

      --
      LoHost
      LoHost - Reliable low cost web hosting with PHP4 and PHP5, MySQL 4 database, htaccess creator and Zend Optimizer. Secure email hosting with authenticated SMTP, IMAP email hosting, webmail, spam blocker, virus blocker, subdomains and vacation. UK hosting, USA hosting, secure hosting, cart hosting, blog hosting, nightly backups, raid servers and more.

      Comment

      • Justin Koivisto

        #4
        Re: How to stop multiple Log In's under the same Username

        Kelv wrote:
        [color=blue]
        > Chris Hall wrote:
        >[color=green]
        >> Any one got any good ideas or where to look for solutions how to stop
        >> multiple log ins with the same username? I am using mysql database if
        >> that
        >> makes a difference.[/color]
        >
        > You could also zap the record in the sessions table for the first
        > instance of the login, meaning they'd have to log in again. If it's a
        > situation where they've shared their login information around, it'll
        > teach them not to do it again.[/color]

        I've actually gone this route before, and didn't have more than a dozen
        complaints in about 2 years. It actually worked out nicer than I had
        expected it to.

        --
        Justin Koivisto - spam@koivi.com

        Comment

        • Gary L. Burnore

          #5
          Re: How to stop multiple Log In's under the same Username

          On Mon, 29 Nov 2004 20:51:09 GMT, Justin Koivisto <spam@koivi.com >
          wrote:
          [color=blue]
          >Kelv wrote:
          >[color=green]
          >> Chris Hall wrote:
          >>[color=darkred]
          >>> Any one got any good ideas or where to look for solutions how to stop
          >>> multiple log ins with the same username? I am using mysql database if
          >>> that
          >>> makes a difference.[/color]
          >>
          >> You could also zap the record in the sessions table for the first
          >> instance of the login, meaning they'd have to log in again. If it's a
          >> situation where they've shared their login information around, it'll
          >> teach them not to do it again.[/color]
          >
          >I've actually gone this route before, and didn't have more than a dozen
          >complaints in about 2 years.[/color]

          How many hits on the site in an average month?

          [color=blue]
          >It actually worked out nicer than I had expected it to.[/color]

          --
          gburnore@databa six dot com
          ---------------------------------------------------------------------------
          How you look depends on where you go.
          ---------------------------------------------------------------------------
          Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³ÝÛº ݳ޳ºÝ³Ý³Þ³ºÝ³Ý ÝÛ³
          | ÝÛ³ºÝ³Þ³ºÝ³³ÝÛº ݳ޳ºÝ³Ý³Þ³ºÝ³Ý ÝÛ³
          DataBasix | ÝÛ³ºÝ³Þ³ºÝ³³ÝÛº ݳ޳ºÝ³Ý³Þ³ºÝ³Ý ÝÛ³
          | ÝÛ³ 3 4 1 4 2 ݳ޳ 6 9 0 6 9 ÝÛ³
          Black Helicopter Repair Svcs Division | Official Proof of Purchase
          =============== =============== =============== =============== ===============
          Want one? GET one! http://signup.databasix.com
          =============== =============== =============== =============== ===============

          Comment

          • Justin Koivisto

            #6
            Re: How to stop multiple Log In's under the same Username

            Gary L. Burnore wrote:
            [color=blue]
            > On Mon, 29 Nov 2004 20:51:09 GMT, Justin Koivisto <spam@koivi.com >
            > wrote:
            >
            >[color=green]
            >>Kelv wrote:
            >>
            >>[color=darkred]
            >>>Chris Hall wrote:
            >>>
            >>>
            >>>>Any one got any good ideas or where to look for solutions how to stop
            >>>>multiple log ins with the same username? I am using mysql database if
            >>>>that
            >>>>makes a difference.
            >>>
            >>>You could also zap the record in the sessions table for the first
            >>>instance of the login, meaning they'd have to log in again. If it's a
            >>>situation where they've shared their login information around, it'll
            >>>teach them not to do it again.[/color]
            >>
            >>I've actually gone this route before, and didn't have more than a dozen
            >>complaints in about 2 years.[/color]
            >
            >
            > How many hits on the site in an average month?[/color]

            At the time there were about 10,000 unique visitors/month and 40,000
            visits based on what AWStats spits out...

            --
            Justin Koivisto - spam@koivi.com

            Comment

            • Gary L. Burnore

              #7
              Re: How to stop multiple Log In's under the same Username

              On Mon, 29 Nov 2004 22:10:47 GMT, Justin Koivisto <spam@koivi.com >
              wrote:
              [color=blue]
              >Gary L. Burnore wrote:
              >[color=green]
              >> On Mon, 29 Nov 2004 20:51:09 GMT, Justin Koivisto <spam@koivi.com >
              >> wrote:
              >>
              >>[color=darkred]
              >>>Kelv wrote:
              >>>
              >>>
              >>>>Chris Hall wrote:
              >>>>
              >>>>
              >>>>>Any one got any good ideas or where to look for solutions how to stop
              >>>>>multiple log ins with the same username? I am using mysql database if
              >>>>>that
              >>>>>makes a difference.
              >>>>
              >>>>You could also zap the record in the sessions table for the first
              >>>>instance of the login, meaning they'd have to log in again. If it's a
              >>>>situation where they've shared their login information around, it'll
              >>>>teach them not to do it again.
              >>>
              >>>I've actually gone this route before, and didn't have more than a dozen
              >>>complaints in about 2 years.[/color]
              >>
              >>
              >> How many hits on the site in an average month?[/color]
              >
              >At the time there were about 10,000 unique visitors/month and 40,000
              >visits based on what AWStats spits out...[/color]

              I can see why you say "better than you thought". 1 in 10,000 isn't
              bad at all.
              --
              gburnore@databa six dot com
              ---------------------------------------------------------------------------
              How you look depends on where you go.
              ---------------------------------------------------------------------------
              Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³ÝÛº ݳ޳ºÝ³Ý³Þ³ºÝ³Ý ÝÛ³
              | ÝÛ³ºÝ³Þ³ºÝ³³ÝÛº ݳ޳ºÝ³Ý³Þ³ºÝ³Ý ÝÛ³
              DataBasix | ÝÛ³ºÝ³Þ³ºÝ³³ÝÛº ݳ޳ºÝ³Ý³Þ³ºÝ³Ý ÝÛ³
              | ÝÛ³ 3 4 1 4 2 ݳ޳ 6 9 0 6 9 ÝÛ³
              Black Helicopter Repair Svcs Division | Official Proof of Purchase
              =============== =============== =============== =============== ===============
              Want one? GET one! http://signup.databasix.com
              =============== =============== =============== =============== ===============

              Comment

              • Chung Leong

                #8
                Re: How to stop multiple Log In's under the same Username

                "Kelv" <not@having.i t> wrote in message
                news:cog1je$kum $1@santiago.kel v.net...[color=blue]
                > Chris Hall wrote:
                >[color=green]
                > > Any one got any good ideas or where to look for solutions how to stop
                > > multiple log ins with the same username? I am using mysql database if[/color][/color]
                that[color=blue][color=green]
                > > makes a difference.[/color]
                >
                > Keep the session id along with ip, login id, and datetime in a sessions
                > table.
                >
                > You can then check login attempts against the session table, and compare
                > the time they logged in against the time now, current IP vs session IP,[/color]
                etc.[color=blue]
                >
                > It's not foolproof though you could at least lock out different IPs from
                > being on at the same time or within a given timeframe.
                >
                > You could also zap the record in the sessions table for the first
                > instance of the login, meaning they'd have to log in again. If it's a
                > situation where they've shared their login information around, it'll
                > teach them not to do it again.
                >
                > Kelv :)
                >
                > --
                > LoHost
                > http://www.lohost.com[/color]

                Checking the IP address is probably not a good strategy nowadays when WiFi
                is so popular. Your user could be browsing your site in a bus, or his WiFi
                adapter could switch to a different base station because the signal of the
                pervious one has become too weak.

                Destroying the previous session is a much more reliable option. And you
                don't really need to implement your own session save-handler. Just remember
                the session id, then delete the previous session file when the user log in
                again. The path is usually session_save_pa th() . "/sess_" . $session_id. Or
                simply scan the session save path, parse in every file, and delete the one
                containing the username (stored as a session variable, presumably).


                Comment

                • R. Rajesh Jeba Anbiah

                  #9
                  Re: How to stop multiple Log In's under the same Username

                  "Chris Hall" <chrish@skwirel .com> wrote in message news:<cofmui$32 h$1@titan.btint ernet.com>...[color=blue]
                  > Hello,
                  >
                  > Any one got any good ideas or where to look for solutions how to stop
                  > multiple log ins with the same username? I am using mysql database if that
                  > makes a difference.[/color]

                  1. http://www.google.com/search?q=php+login
                  2. http://martin.f2o.org/php/login

                  If IP check gives you trouble, just ignore it. Session id check
                  alone is sufficient. If you're more particular, you may try to check
                  user agent, lanugage, etc.

                  --
                  <?php echo 'Just another PHP saint'; ?>
                  Email: rrjanbiah-at-Y!com

                  Comment

                  Working...