is $_SERVER['REMOTE_ADDR'] and CurrentUserID() equal ?

hi,i tried to record the last ip address of a successful login user.
when i test CurrentUserID() , it returns “::1” .

i do not understand because it should return something like my public ip 125.147.255.89 (example).shall you have help of infos about that ?

maybe the problem come from my query ?// User Logged In event
function User_LoggedIn($usr) {
//echo “User Logged In”;
$sql=“UPDATE users SET user_last_logindate=NOW(),”;
$sql.=“user_last_ip='”.CurrentUserIP().“'”;
//$sql.=“user_last_ip='”.$_SERVER[‘REMOTE_ADDR’].“'”;
$sql.=" WHERE user_id=“.CurrentUserID().”;";
$rs = Conn()->execute($sql);
}the execution is well (without error) but IP is already “::1” !
strange.

IP Address will return “::1” if you are running web app from localhost server instead of remote server.