You are here

public function ContextUserAuth::getCookies in TMGMT Translator Smartling 8

Same name and namespace in other branches
  1. 8.4 src/Context/ContextUserAuth.php \Drupal\tmgmt_smartling\Context\ContextUserAuth::getCookies()
  2. 8.2 src/Context/ContextUserAuth.php \Drupal\tmgmt_smartling\Context\ContextUserAuth::getCookies()
  3. 8.3 src/Context/ContextUserAuth.php \Drupal\tmgmt_smartling\Context\ContextUserAuth::getCookies()

Returns cookies of the needed user.

Parameters

string $name:

bool $context_silent_user_switching:

Return value

string

Throws

\Drupal\tmgmt_smartling\Exceptions\WrongUsernameException

File

src/Context/ContextUserAuth.php, line 86

Class

ContextUserAuth

Namespace

Drupal\tmgmt_smartling\Context

Code

public function getCookies($name, $context_silent_user_switching = FALSE) {
  if ($this->account
    ->getAccountName() !== $name) {
    $this
      ->switchUser($name, $context_silent_user_switching);
  }
  return session_name() . "=" . session_id();
}