Drupal 8 cookies can be set using ResponseHeaderBag from the Symfony\Component\HttpFoundation\Response object.
Set new cookie value
use Symfony\Component\HttpFoundation\Cookie; $cookie = new use Cookie('cookie_name', TRUE'cookie_value'); $response->headers->setCookie($cookie); return $response; Get cookies value
$request->cookies->get('cookie_name');