/** * Checks whether the user agent has changed since the last request. * * Returns TRUE in case the user agent has not changed since the last request. * Otherwise returns FALSE. * * @see \Ableron\Core\Session\Validators\ValidatorInterface::isValid() */ public function isValid(SessionEntity $session) { return $session->getData('sessionValidation.lastAccessUserAgent') === EnvironmentUtil::getEnvironmentVariable('HTTP_USER_AGENT'); }
/** * Checks whether the IP address of the user has changed since the last * request. * * Returns TRUE in case the IP address of the user has changed since the * last request. * Otherwise returns FALSE. * * TODO: Implement better way of guessing the user IP * TODO: Save current IP on every request as we are checking IP parts instead of the full address (at least with IPv4) * * @see \Ableron\Core\Session\Validators\ValidatorInterface::isValid() */ public function isValid(SessionEntity $session) { return $session->getData('sessionValidation.lastAccessIpAddress') === EnvironmentUtil::getEnvironmentVariable('REMOTE_ADDR'); }