__construct()
getData()
getName()
getUseProxy()
isValid()
setProxyHeader()
setTrustedProxies()
setUseProxy()
getIpAddress()
$data
$proxyHeader
$trustedProxies
$useProxy
__construct(null | string $data)
nullstring
getData() : string
stringgetName() : string
stringgetUseProxy() : bool
boolCurrent setting value.isValid() : bool
boolsetProxyHeader(string $header) : void
string
setTrustedProxies(array $trustedProxies) : void
array
setUseProxy(bool $useProxy) : void
This must be static method, since validators are recovered automatically at session read, so this is the only way to switch setting.
boolWhether to check also proxied IP addresses.
getIpAddress() : string
stringIP address.$data : string
$proxyHeader : string
$trustedProxies : array
$useProxy : bool
As default this setting is disabled - IP address is mostly needed to increase security. HTTP_* are not reliable since can easily be spoofed. It can be enabled just for more flexibility, but if user uses proxy to connect to trusted services it's his/her own risk, only reliable field for IP address is $_SERVER['REMOTE_ADDR'].