PHP / Javascript: specify two computers separately from the same network

I am developing a site where you are not allowed to log in to multiple accounts on the same computer, but I do not know how to do this. This method should be:

  • Cross-platform (can be used for Windows / Mac / Linux clients).
  • Independent browser.

This is done so that some users do not use multiple users to obtain unfair advantages, while simultaneously allowing two people on the local network to connect as long as they are on different computers.

Any tips?

+3
source share
7 answers

: , , .

, Flash Cookies. , , , . , : Flash Cookie Manager.

, Flash iPhone, , .

. Wikipedia .

+2

Cookie, "Evercookie" http://samy.pl/evercookie/, cookie .

, , cookie .

: , , JS, , .

, IP- , 2 :  - -  - NAT'ed enviroments.

+4

IP- , , , -, .

- - , HTTP- "X-Forwarded-For", IP- . $_SERVER ['REMOTE_ADDR'] X-Forwarded-For . X-Forwarded-For , IP-.

X-Forwarded-For php:

$headers = apache_request_headers(); 
$full_client_id = $_SERVER['REMOTE_ADDR'] . '|' . $headers["X-Forwarded-For"];

$full_client_id, , , "123.1.2.3 | 192.168.1.1" , .

, , .

+1

.

:

<?php
$a = session_id();
if(empty($a)) session_start();
echo "SID: ".SID."<br>session_id(): ".session_id()."<br>COOKIE: ".$_COOKIE["PHPSESSID"];
?>

. Session_id() . , firefox SID, Internet Explorer PHPSESSID. session_id.

+1

, , - IP, $_SERVER ['REMOTE_ADDR'], . , IP- , , .

0

, .

, ip- , - , .

,

, , , javascript heartbeat witch, , PHP .

A , IP , B .

IP-, , ,

user_id         ip                hits
--------------------------------------
1             xxx.yyy.zzz.244     6
1             xxx.yyy.zzz.224     4
1             xxx.yyy.zzz.264     1
1             xxx.yyy.zzz.124     1
1             xxx.yyy.zzz.174     1
2             aaa.bbb.zzz.678     3
.....

, A B , , IP- , , ,

0

(IsLoggedIn), , ?

, :

  • IP: , , - IP-.

  • cookie: . , . IE Firefox.

0

Source: https://habr.com/ru/post/1771087/


All Articles