You are here

protected function KernelTerminateSubscriber::_getUserAgent in Visitors 8.2

Get visitor user agent.

Return value

string string user agent, or empty string if user agent does not exist

1 call to KernelTerminateSubscriber::_getUserAgent()
KernelTerminateSubscriber::onTerminate in src/EventSubscriber/KernelTerminateSubscriber.php
Store visitors data when a request terminates.

File

src/EventSubscriber/KernelTerminateSubscriber.php, line 155
Contains Drupal\visitors\EventSubscriber\KernelTerminateSubscriber.

Class

KernelTerminateSubscriber
Store visitors data when a request terminates.

Namespace

Drupal\visitors\EventSubscriber

Code

protected function _getUserAgent() {
  return isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
}