Deprecated: Constant E_STRICT is deprecated in /home/pastorz/old-espace-client/vendor/symfony/error-handler/ErrorHandler.php on line 58

Deprecated: Constant E_STRICT is deprecated in /home/pastorz/old-espace-client/vendor/symfony/error-handler/ErrorHandler.php on line 76
Symfony Profiler

vendor/symfony/http-foundation/Session/Storage/NativeSessionStorageFactory.php line 17

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the Symfony package.
  4.  *
  5.  * (c) Fabien Potencier <fabien@symfony.com>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace Symfony\Component\HttpFoundation\Session\Storage;
  11. use Symfony\Component\HttpFoundation\Request;
  12. // Help opcache.preload discover always-needed symbols
  13. class_exists(NativeSessionStorage::class);
  14. /**
  15.  * @author Jérémy Derussé <jeremy@derusse.com>
  16.  */
  17. class NativeSessionStorageFactory implements SessionStorageFactoryInterface
  18. {
  19.     private $options;
  20.     private $handler;
  21.     private $metaBag;
  22.     private $secure;
  23.     /**
  24.      * @see NativeSessionStorage constructor.
  25.      */
  26.     public function __construct(array $options = [], $handler nullMetadataBag $metaBag nullbool $secure false)
  27.     {
  28.         $this->options $options;
  29.         $this->handler $handler;
  30.         $this->metaBag $metaBag;
  31.         $this->secure $secure;
  32.     }
  33.     public function createStorage(?Request $request): SessionStorageInterface
  34.     {
  35.         $storage = new NativeSessionStorage($this->options$this->handler$this->metaBag);
  36.         if ($this->secure && $request && $request->isSecure()) {
  37.             $storage->setOptions(['cookie_secure' => true]);
  38.         }
  39.         return $storage;
  40.     }
  41. }