I would use cookies for this. Set a cookie when a user logs in (check first to make sure that it does not exist). An easy way to generate a unique identifier for this user is to hash your IP plus the current time.
$id = md5($_SERVER['REMOTE_ADDR'] . time());
Save this identifier in your database and use it for reference
, , $_SERVER ['PHP_SELF'], $_SERVER ['REQUEST_URI'] php-. . php.net , _SERVER, , , , , (ex index.php). .
, , , , . cookie cookie .