diff --git a/src/Auth.php b/src/Auth.php index 5e414b4..f1209fa 100644 --- a/src/Auth.php +++ b/src/Auth.php @@ -50,7 +50,7 @@ final class Auth extends UserManager { $this->useHttps = $useHttps; $this->allowCookiesScriptAccess = $allowCookiesScriptAccess; - $this->ipAddress = empty($ipAddress) ? $_SERVER['REMOTE_ADDR'] : $ipAddress; + $this->ipAddress = !empty($ipAddress) ? $ipAddress : (isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : null); $this->initSession(); $this->enhanceHttpSecurity();