modules/acm/src/User/AccessTokenTrait.php
public function setAccessToken($token = NULL, $expire = 0) {
    if (!empty($expire)) {
      $expire = REQUEST_TIME + $expire;
    }

    if (isset(\Drupal::request()->cookies)) {
      \Drupal::request()->cookies->set('Drupal_visitor_' . $this->accessTokenCookie, $token);
    }

    setrawcookie('Drupal.visitor.' . $this->accessTokenCookie, rawurlencode($token), $expire, '/');
  }
public function setAccessToken($token = NULL, $expire = 0) {
    if (!empty($expire)) {
      $expire = REQUEST_TIME + $expire;
    }

    if (isset(\Drupal::request()->cookies)) {
      \Drupal::request()->cookies->set('Drupal_visitor_' . $this->accessTokenCookie, $token);
    }

    setrawcookie('Drupal.visitor.' . $this->accessTokenCookie, rawurlencode($token), $expire, '/');
  }
public function setAccessToken ( $ token = NULL , $ expire = 0 ) { if ( ! empty ( $ expire ) ) { $ expire = REQUEST_TIME + $ expire ; } if ( isset ( \ Drupal :: request ( ) -> cookies ) ) { \ Drupal :: request ( ) -> cookies -> set ( 'Drupal_visitor_' . $ this -> accessTokenCookie , $ token ) ; } setrawcookie ( 'Drupal.visitor.' . $ this -> accessTokenCookie , rawurlencode ( $ token ) , $ expire , '/' ) ; }
Sets the customer access token.

@param string $token
The access token.
@param null|int $expire
How long from now until the cookie expires, in ms. NULL for expire with
session, int for custom expiry.
Sets the customer access token .