I tired so many solutions but nothing worked, I tried using clients mac address as unique device id for the user then checking once logging process started that this mac address is allowed mac address stored in then database. this was the code :
$MAC = exec('getmac');
// Storing 'getmac' value in $MAC
$MAC = strtok($MAC, ' ');
// Updating $MAC value using strtok function,
// strtok is used to split the string into tokens
// split character of strtok is defined as a space
// because getmac returns transport name after
// MAC address
echo "MAC address of client is: $MAC";
But this code always returns server mac address