You are here

public function SetAltCookiesController::setCookies in Anti Spam by CleanTalk 8.4

Same name and namespace in other branches
  1. 9.1.x src/Controller/SetAltCookiesController.php \Drupal\cleantalk\Controller\SetAltCookiesController::setCookies()

File

src/Controller/SetAltCookiesController.php, line 10

Class

SetAltCookiesController

Namespace

Drupal\cleantalk\Controller

Code

public function setCookies(Request $request) {
  $content = $request
    ->getContent();
  $content = json_decode($content, true);
  if (!empty($content) && is_array($content)) {
    foreach ($content as $cookie) {
      CleantalkFuncs::apbct_setcookie($cookie['name'], $cookie['value']);
    }
  }
  die;
}