You are here

public function ContextCurrentUserAuth::getCookies in TMGMT Translator Smartling 8

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

Returns cookies of the needed user.

Parameters

string $name:

Return value

string

Throws

WrongUsernameException

File

src/Context/ContextCurrentUserAuth.php, line 31

Class

ContextCurrentUserAuth

Namespace

Drupal\tmgmt_smartling\Context

Code

public function getCookies($name) {
  if ($this->currentAccount
    ->getAccountName() !== $name) {
    throw new WrongUsernameException('You tried to authenticate with a username that is different from the current user. This feature wasn\'t implemented yet.');
  }
  return session_name() . "=" . session_id();
}