CookieSameSiteSessionConfiguration.php in Media: Acquia DAM 8
File
src/Session/CookieSameSiteSessionConfiguration.php
View source
<?php
namespace Drupal\media_acquiadam\Session;
use Drupal\Core\Session\SessionConfiguration;
use Symfony\Component\HttpFoundation\Request;
class CookieSameSiteSessionConfiguration extends SessionConfiguration {
public function getOptions(Request $request) {
$options = parent::getOptions($request);
$config = \Drupal::configFactory()
->getEditable('media_acquiadam.settings');
if ($config
->get('samesite_cookie_disable')) {
return $options;
}
if (isset($options['cookie_secure']) && $options['cookie_secure'] == TRUE) {
$options['cookie_samesite'] = 'None';
}
return $options;
}
}