__construct()
getData()
getName()
getUseProxy()
isValid()
setProxyHeader()
setTrustedProxies()
setUseProxy()
getIpAddress()
$data
$proxyHeader
$trustedProxies
$useProxy
__construct(null | string $data)
nullstring
getData() : string
string
getName() : string
string
getUseProxy() : bool
bool
Current setting value.isValid() : bool
bool
setProxyHeader(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.
bool
Whether to check also proxied IP addresses.
getIpAddress() : string
string
IP 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'].