You are here

class AuthSessionDataHandler in Open Social 8.2

Same name and namespace in other branches
  1. 8.9 modules/custom/social_auth_extra/src/AuthSessionDataHandler.php \Drupal\social_auth_extra\AuthSessionDataHandler
  2. 8 modules/custom/social_auth_extra/src/AuthSessionDataHandler.php \Drupal\social_auth_extra\AuthSessionDataHandler
  3. 8.3 modules/custom/social_auth_extra/src/AuthSessionDataHandler.php \Drupal\social_auth_extra\AuthSessionDataHandler
  4. 8.4 modules/custom/social_auth_extra/src/AuthSessionDataHandler.php \Drupal\social_auth_extra\AuthSessionDataHandler
  5. 8.5 modules/custom/social_auth_extra/src/AuthSessionDataHandler.php \Drupal\social_auth_extra\AuthSessionDataHandler
  6. 8.6 modules/custom/social_auth_extra/src/AuthSessionDataHandler.php \Drupal\social_auth_extra\AuthSessionDataHandler
  7. 8.7 modules/custom/social_auth_extra/src/AuthSessionDataHandler.php \Drupal\social_auth_extra\AuthSessionDataHandler
  8. 8.8 modules/custom/social_auth_extra/src/AuthSessionDataHandler.php \Drupal\social_auth_extra\AuthSessionDataHandler

Class AuthSessionDataHandler.

@package Drupal\social_auth_extra

Hierarchy

Expanded class hierarchy of AuthSessionDataHandler

1 file declares its use of AuthSessionDataHandler
FacebookAuthPersistentDataHandler.php in modules/custom/social_auth_facebook/src/FacebookAuthPersistentDataHandler.php
1 string reference to 'AuthSessionDataHandler'
social_auth_extra.services.yml in modules/custom/social_auth_extra/social_auth_extra.services.yml
modules/custom/social_auth_extra/social_auth_extra.services.yml
1 service uses AuthSessionDataHandler
social_auth_extra.session_persistent_data_handler in modules/custom/social_auth_extra/social_auth_extra.services.yml
\Drupal\social_auth_extra\AuthSessionDataHandler

File

modules/custom/social_auth_extra/src/AuthSessionDataHandler.php, line 12

Namespace

Drupal\social_auth_extra
View source
class AuthSessionDataHandler implements AuthDataHandlerInterface {

  /**
   * Used for storing the session.
   *
   * @var \Symfony\Component\HttpFoundation\Session\SessionInterface
   */
  protected $session;

  /**
   * Used for storing the session prefix.
   *
   * @var string
   */
  protected $sessionPrefix;

  /**
   * Constructor.
   *
   * @param \Symfony\Component\HttpFoundation\Session\SessionInterface $session
   *   Used for reading data from and writing data to session.
   */
  public function __construct(SessionInterface $session) {
    $this->session = $session;
  }

  /**
   * {@inheritdoc}
   */
  public function get($key) {
    return $this->session
      ->get($this->sessionPrefix . $key);
  }

  /**
   * {@inheritdoc}
   */
  public function set($key, $value) {
    $this->session
      ->set($this->sessionPrefix . $key, $value);
  }

  /**
   * {@inheritdoc}
   */
  public function setPrefix($prefix) {
    $this->sessionPrefix = $prefix;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AuthSessionDataHandler::$session protected property Used for storing the session.
AuthSessionDataHandler::$sessionPrefix protected property Used for storing the session prefix.
AuthSessionDataHandler::get public function Get a value from a persistent data store. Overrides AuthDataHandlerInterface::get
AuthSessionDataHandler::set public function Set a value in the persistent data store. Overrides AuthDataHandlerInterface::set
AuthSessionDataHandler::setPrefix public function Set a key which will be used as prefix for keys in the storage. Overrides AuthDataHandlerInterface::setPrefix
AuthSessionDataHandler::__construct public function Constructor.