You are here

public function TawktoController::set_widget in tawk.to Live Chat (Drupal 8) 8

1 string reference to 'TawktoController::set_widget'
tawk_to.routing.yml in tawk_to/tawk_to.routing.yml
tawk_to/tawk_to.routing.yml

File

tawk_to/src/Controller/TawktoController.php, line 68

Class

TawktoController

Namespace

Drupal\tawk_to\Controller

Code

public function set_widget() {
  if (!empty($_REQUEST) && 'POST' == $_SERVER["REQUEST_METHOD"]) {
    foreach ($_REQUEST as $key => $value) {
      if (stripos($key, 'SESS') !== false) {
        if ($value == \Drupal::service('session')
          ->getId()) {
          return $this
            ->_set($_REQUEST);
        }
      }
    }
  }
}