class Session implements HttpKernelInterface (View source)

Wrap session logic around a HTTP request.

Note, the session service is not injected into this class in order to prevent premature initialization of session storage (database). Instead the session service is retrieved from the container only when handling the request.

Traits

ContainerAwareTrait

Properties

protected HttpKernelInterface $httpKernel

The wrapped HTTP kernel.

protected string $sessionServiceName

The session service name.

Methods

__construct(HttpKernelInterface $http_kernel, string $service_name = 'session')

Constructs a Session stack middleware object.

handle(Request $request, $type = self::MASTER_REQUEST, $catch = TRUE)

{@inheritdoc}

Details

__construct(HttpKernelInterface $http_kernel, string $service_name = 'session')

Constructs a Session stack middleware object.

Parameters

HttpKernelInterface $http_kernel

The decorated kernel.

string $service_name

The name of the session service, defaults to "session".

handle(Request $request, $type = self::MASTER_REQUEST, $catch = TRUE)

{@inheritdoc}

Parameters

Request $request
$type
$catch