class FacebookAuthPersistentDataHandler in Social Auth Facebook 8
Variables are written to and read from session via this class.
By default, Facebook SDK uses native PHP sessions for storing data. We implement Facebook\PersistentData\PersistentDataInterface using Symfony Sessions so that Facebook SDK will use that instead of native PHP sessions. Also SimpleFbConnect reads data from and writes data to session via this class.
Hierarchy
- class \Drupal\social_auth_facebook\FacebookAuthPersistentDataHandler implements \Facebook\PersistentData\PersistentDataInterface
Expanded class hierarchy of FacebookAuthPersistentDataHandler
See also
https://developers.facebook.com/docs/php/PersistentDataInterface/5.0.0
2 files declare their use of FacebookAuthPersistentDataHandler
- FacebookAuth.php in src/
Plugin/ Network/ FacebookAuth.php - FacebookAuthController.php in src/
Controller/ FacebookAuthController.php
1 string reference to 'FacebookAuthPersistentDataHandler'
1 service uses FacebookAuthPersistentDataHandler
File
- src/
FacebookAuthPersistentDataHandler.php, line 19
Namespace
Drupal\social_auth_facebookView source
class FacebookAuthPersistentDataHandler implements PersistentDataInterface {
protected $session;
protected $sessionPrefix = 'social_auth_facebook_';
/**
* 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
->getSessionPrefix() . $key);
}
/**
* {@inheritdoc}
*/
public function set($key, $value) {
$this->session
->set($this
->getSessionPrefix() . $key, $value);
}
/**
* Gets the session prefix for the data handler.
*
* @return string
* The session prefix.
*/
public function getSessionPrefix() {
return $this->sessionPrefix;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FacebookAuthPersistentDataHandler:: |
protected | property | ||
FacebookAuthPersistentDataHandler:: |
protected | property | ||
FacebookAuthPersistentDataHandler:: |
public | function | ||
FacebookAuthPersistentDataHandler:: |
public | function | Gets the session prefix for the data handler. | |
FacebookAuthPersistentDataHandler:: |
public | function | ||
FacebookAuthPersistentDataHandler:: |
public | function | Constructor. |