There is the following code defining the client ip.

$kernelVars['userIp'] = (!empty($HTTP_SERVER_VARS['REMOTE_ADDR'])) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ((!empty($HTTP_ENV_VARS['REMOTE_ADDR'])) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : $_SERVER['REMOTE_ADDR']); 

However, in Opera and Mobile Chrome goes empty.

  • $ _SERVER ['REMOTE_ADDR'] and that's it. - Rou1997

1 answer 1

In the opera, it is possible through a browser proxy that works (not 100% information). Through mobile browsers Internet works exactly through transparent proxies. And it turns out that one header to determine ip is very small. At a minimum, there is also HTTP_X_FORWARDED_FOR . Regarding the definition of the client's ip address, I can recommend you an article on Habré , which personally helped me a lot to figure out what was happening.