I hash cookies, but it turns out the same hash, although all strings are different.
(string) $server_name = hash("sha512", $_SERVER[SERVER_NAME]); if($server_name != null) { setcookie("domain", $server_name); echo("$server_name"); } (string) $ip = hash("sha512", $_SERVER[REMOTE_ADDR]); if($ip != null) { setcookie("IP", $ip); echo("$ip"); }
sha521? And why are you hashing$_SERVER[SERVER_NAME]and$_SERVER[REMOTE_ADDR]? Do you think about their content or who does not guess from the name of the cook? Hash algorithms can be viewed here php.net/manual/ru/function.hash-algos.php - Visman