class CookieSameSiteSessionConfiguration in Media: Acquia DAM 8
Defines the default session configuration generator.
Hierarchy
- class \Drupal\Core\Session\SessionConfiguration implements SessionConfigurationInterface
- class \Drupal\media_acquiadam\Session\CookieSameSiteSessionConfiguration
Expanded class hierarchy of CookieSameSiteSessionConfiguration
1 string reference to 'CookieSameSiteSessionConfiguration'
1 service uses CookieSameSiteSessionConfiguration
File
- src/
Session/ CookieSameSiteSessionConfiguration.php, line 11
Namespace
Drupal\media_acquiadam\SessionView source
class CookieSameSiteSessionConfiguration extends SessionConfiguration {
/**
* {@inheritdoc}
*/
public function getOptions(Request $request) {
$options = parent::getOptions($request);
// Return defaults if configuration tells us to disable the bypass.
$config = \Drupal::configFactory()
->getEditable('media_acquiadam.settings');
if ($config
->get('samesite_cookie_disable')) {
return $options;
}
// Set the cookie samesite option to None.
if (isset($options['cookie_secure']) && $options['cookie_secure'] == TRUE) {
$options['cookie_samesite'] = 'None';
}
return $options;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CookieSameSiteSessionConfiguration:: |
public | function |
Returns a list of options suitable for passing to the session storage. Overrides SessionConfiguration:: |
|
SessionConfiguration:: |
protected | property | An associative array of session ini settings. | |
SessionConfiguration:: |
protected | function | Wraps drupal_valid_test_ua(). | |
SessionConfiguration:: |
protected | function | Return the session cookie domain. | |
SessionConfiguration:: |
protected | function | Returns the session cookie name. | |
SessionConfiguration:: |
protected | function | Returns the session cookie name without the secure/insecure prefix. | |
SessionConfiguration:: |
public | function |
Determines whether a session identifier is on the request. Overrides SessionConfigurationInterface:: |
|
SessionConfiguration:: |
public | function | Constructs a new session configuration instance. |