You are here

public function NativeSessionStorage::setOptions 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::setOptions()

Sets session.* ini variables.

For convenience we omit 'session.' from the beginning of the keys. Explicitly ignores other ini keys.

Parameters

array $options Session ini directives array(key => value).:

See also

http://php.net/session.configuration

2 calls to NativeSessionStorage::setOptions()
NativeSessionStorage::__construct in vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php
Constructor.
SessionManager::start in core/lib/Drupal/Core/Session/SessionManager.php
Starts the session.

File

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

Class

NativeSessionStorage
This provides a base class for session attribute storage.

Namespace

Symfony\Component\HttpFoundation\Session\Storage

Code

public function setOptions(array $options) {
  $validOptions = array_flip(array(
    'cache_limiter',
    'cookie_domain',
    'cookie_httponly',
    'cookie_lifetime',
    'cookie_path',
    'cookie_secure',
    'entropy_file',
    'entropy_length',
    'gc_divisor',
    'gc_maxlifetime',
    'gc_probability',
    'hash_bits_per_character',
    'hash_function',
    'name',
    'referer_check',
    'serialize_handler',
    'use_cookies',
    'use_only_cookies',
    'use_trans_sid',
    'upload_progress.enabled',
    'upload_progress.cleanup',
    'upload_progress.prefix',
    'upload_progress.name',
    'upload_progress.freq',
    'upload_progress.min-freq',
    'url_rewriter.tags',
  ));
  foreach ($options as $key => $value) {
    if (isset($validOptions[$key])) {
      ini_set('session.' . $key, $value);
    }
  }
}