You are here

public function NativeSessionStorage::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php \Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage::__construct()

Constructor.

Depending on how you want the storage driver to behave you probably want to override this constructor entirely.

List of options for $options array with their defaults.

but we omit 'session.' from the beginning of the keys for convenience.

("auto_start", is not supported as it tells PHP to start a session before PHP starts to execute user-land code. Setting during runtime has no effect).

cache_limiter, "" (use "0" to prevent headers from being sent entirely). cookie_domain, "" cookie_httponly, "" cookie_lifetime, "0" cookie_path, "/" cookie_secure, "" entropy_file, "" entropy_length, "0" gc_divisor, "100" gc_maxlifetime, "1440" gc_probability, "1" hash_bits_per_character, "4" hash_function, "0" name, "PHPSESSID" referer_check, "" serialize_handler, "php" use_cookies, "1" use_only_cookies, "1" use_trans_sid, "0" upload_progress.enabled, "1" upload_progress.cleanup, "1" upload_progress.prefix, "upload_progress_" upload_progress.name, "PHP_SESSION_UPLOAD_PROGRESS" upload_progress.freq, "1%" upload_progress.min-freq, "1" url_rewriter.tags, "a=href,area=href,frame=src,form=,fieldset="

Parameters

array $options Session configuration options.:

AbstractProxy|NativeSessionHandler|\SessionHandlerInterface|null $handler:

MetadataBag $metaBag MetadataBag.:

See also

http://php.net/session.configuration for options

1 call to NativeSessionStorage::__construct()
SessionManager::__construct in core/lib/Drupal/Core/Session/SessionManager.php
Constructs a new session manager instance.
2 methods override NativeSessionStorage::__construct()
PhpBridgeSessionStorage::__construct in vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorage.php
Constructor.
SessionManager::__construct in core/lib/Drupal/Core/Session/SessionManager.php
Constructs a new session manager instance.

File

vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php, line 99

Class

NativeSessionStorage
This provides a base class for session attribute storage.

Namespace

Symfony\Component\HttpFoundation\Session\Storage

Code

public function __construct(array $options = array(), $handler = null, MetadataBag $metaBag = null) {
  session_cache_limiter('');

  // disable by default because it's managed by HeaderBag (if used)
  ini_set('session.use_cookies', 1);
  if (PHP_VERSION_ID >= 50400) {
    session_register_shutdown();
  }
  else {
    register_shutdown_function('session_write_close');
  }
  $this
    ->setMetadataBag($metaBag);
  $this
    ->setOptions($options);
  $this
    ->setSaveHandler($handler);
}