I need to prevent my users to log in with two accounts at the same time with one PC , i tried to shoot out users with the same IP addresses but it will not allow to the users that they logging in from one router with different PCs, because they have equal IP addresses. In other word i want to know if some guys with equal IPs using one device or different devices.
Asked
Active
Viewed 389 times
-1
-
Use personal cookies for this – Peon Jan 20 '14 at 07:15
-
It's not usefull because they can login with two browsers – Amin Gholibeigian Jan 20 '14 at 07:18
-
It's not possible to do this, if you also want to allow users behind NAT devices (which is virtually everybody these days). Why do you want this, what are you trying to protect yourself against? – deceze Jan 20 '14 at 07:19
-
I want to allow if they use multiple devices , but not when they use one device for two log ins at same time – Amin Gholibeigian Jan 20 '14 at 07:22
-
Why, what's the difference? What if there are really two humans sharing one PC? – deceze Jan 20 '14 at 07:23
-
Problem is to being log in at the same time. – Amin Gholibeigian Jan 20 '14 at 07:26
-
That still doesn't really answer the "why"... But the only chance would be if you installed a plugin which can generate a unique id for the computer, cross-browser. That's a pretty tall order for a regular website. – deceze Jan 20 '14 at 07:28
-
And why is it ok for one user to have two computers side by side, but it's not ok for that same guy to use just one computer? – deceze Jan 20 '14 at 07:29
-
Because they have not six computer at home. – Amin Gholibeigian Jan 20 '14 at 07:31
2 Answers
0
In your case, using both MAC address and IP address should satisfy your request.
MAC Address can used to classify clients within a local network.
So it can classify client share the same IP address by a router.
But get the MAC adddress of client may not possible by using PHP.
Here is some reference and a case using Java Applet. I hope it can help you.
Community
- 1
- 1
L.C. Echo Chan
- 586
- 12
- 29
-
No, because it should only be done on client side in your case. And PHP ususually run on server side. – L.C. Echo Chan Jan 21 '14 at 01:55