class SessionConfiguration implements SessionConfigurationInterface (View source)

Defines the default session configuration generator.

Properties

protected $options

An associative array of session ini settings.

Methods

__construct(array $options = [])

Constructs a new session configuration instance.

bool
hasSession(Request $request)

Determines whether a session identifier is on the request.

array
getOptions(Request $request)

Returns a list of options suitable for passing to the session storage.

string
getName(Request $request)

Returns the session cookie name.

getUnprefixedName(Request $request)

Returns the session cookie name without the secure/insecure prefix.

getCookieDomain(Request $request)

Return the session cookie domain.

string|false
drupalValidTestUa()

Wraps drupal_valid_test_ua().

Details

__construct(array $options = [])

Constructs a new session configuration instance.

Parameters

array $options

An associative array of session ini settings.

See also

\Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage::__construct()
http://php.net/manual/session.configuration.php
https://www.php.net/manual/session.security.ini.php

bool hasSession(Request $request)

Determines whether a session identifier is on the request.

This method detects whether a session was started during one of the previous requests from the same user agent. Session identifiers are normally passed along using cookies and hence a typical implementation checks whether the session cookie is on the request.

Parameters

Request $request

The request.

Return Value

bool

TRUE if there is a session identifier on the request.

array getOptions(Request $request)

Returns a list of options suitable for passing to the session storage.

Parameters

Request $request

The request.

Return Value

array

An associative array of session ini settings.

protected string getName(Request $request)

Returns the session cookie name.

Parameters

Request $request

The request.

Return Value

string

The name of the session cookie.

protected getUnprefixedName(Request $request)

Returns the session cookie name without the secure/insecure prefix.

Parameters

Request $request

The request.

protected getCookieDomain(Request $request)

Return the session cookie domain.

The Set-Cookie response header and its domain attribute are defined in RFC 2109, RFC 2965 and RFC 6265 each one superseding the previous version.

protected string|false drupalValidTestUa()

Wraps drupal_valid_test_ua().

Return Value

string|false

Either the simpletest prefix (the string "simpletest" followed by any number of digits) or FALSE if the user agent does not contain a valid HMAC and timestamp.