Get the user IP address : REMOTE_ADDR By editor, 28 November, 2015 Question How to get the ip address properly in Drupal 8 ? Drupal do not like using the $_SERVER['REMOTE_ADDR']; to get the remote ip (the user ip address). In Drupal 7, the function ip_address() exist but not in D8. $ip = ip_address(); Drupal 8 $ip = \Drupal::request()->getClientIp(); Tags Drupal 8 Code User Add new comment