473,378 Members | 1,391 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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
Jul 17 '05 #1
8 3030
On Mon, 29 Nov 2004 17:40:34 +0000 (UTC), "Chris Hall"
<ch****@skwirel.com> wrote:
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.


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@databasix 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
================================================== =========================
Jul 17 '05 #2
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.


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
http://www.lohost.com
Jul 17 '05 #3
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. It actually worked out nicer than I had
expected it to.

--
Justin Koivisto - sp**@koivi.com
http://www.koivi.com
Jul 17 '05 #4
On Mon, 29 Nov 2004 20:51:09 GMT, Justin Koivisto <sp**@koivi.com>
wrote:
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.


How many hits on the site in an average month?

It actually worked out nicer than I had expected it to.


--
gburnore@databasix 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
================================================== =========================
Jul 17 '05 #5
Gary L. Burnore wrote:
On Mon, 29 Nov 2004 20:51:09 GMT, Justin Koivisto <sp**@koivi.com>
wrote:

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.

How many hits on the site in an average month?


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

--
Justin Koivisto - sp**@koivi.com
http://www.koivi.com
Jul 17 '05 #6
On Mon, 29 Nov 2004 22:10:47 GMT, Justin Koivisto <sp**@koivi.com>
wrote:
Gary L. Burnore wrote:
On Mon, 29 Nov 2004 20:51:09 GMT, Justin Koivisto <sp**@koivi.com>
wrote:

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.

How many hits on the site in an average month?


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


I can see why you say "better than you thought". 1 in 10,000 isn't
bad at all.
--
gburnore@databasix 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
================================================== =========================
Jul 17 '05 #7
"Kelv" <no*@having.it> wrote in message
news:co**********@santiago.kelv.net...
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.
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
http://www.lohost.com


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_path() . "/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).
Jul 17 '05 #8
"Chris Hall" <ch****@skwirel.com> wrote in message news:<co**********@titan.btinternet.com>...
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.


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
Jul 17 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Lou | last post by:
Please can someone put me out my misery! Im trying to find a multiple user/password protection script that will redirect the specific user to a specific directory. At the moment I have set up...
6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
18
by: Gleep | last post by:
I've searched google intensely on this topic and it seems noone really knows how to approch this. The goal I don't want clients to give out their usernames and passwords to friends, since the site...
4
by: Jeff | last post by:
Hey gang. I have a form to select multiple names. The problem I am having, is when it gets to the asp page. If I click 1 name, it will process. But multiple names gives me an error: Either BOF or...
1
by: ykong1214 | last post by:
In my project, there is a single select tag, <html:select property="userName" size="7"> <html:options collection="UserList" property="value" labelProperty="label" /> </html:select> ...
3
by: anuragpj | last post by:
i have designed a login page like this: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Electrical Engineering Dept...
3
by: Goran Djuranovic | last post by:
Hi all, I have a web app running on a local PC that can start and stop windows service on a remote machine, but only when I browse to it locally. If I browse to it from my other PC and try to...
2
by: dylanhughes | last post by:
I'm looking for an example of a login system that has multiple fields (2 to be exact) + password. e.g username, company name and password, the user, company and password are checked against a mysql...
9
lotus18
by: lotus18 | last post by:
Hello world. I'm trying to teach myself and I'm having trouble with this simple codes. I just want to show if the user typed the username and the password correctly, Now the problem goes like...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.