You are here

public function SessionTestController::noSet in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php \Drupal\session_test\Controller\SessionTestController::noSet()

Turns off session saving and then tries to save a value anyway.

Parameters

string $test_value: A session value.

Return value

string A notification message.

1 string reference to 'SessionTestController::noSet'
session_test.routing.yml in core/modules/system/tests/modules/session_test/session_test.routing.yml
core/modules/system/tests/modules/session_test/session_test.routing.yml

File

core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php, line 105
Contains \Drupal\session_test\Controller\SessionTestController.

Class

SessionTestController
Controller providing page callbacks for the action admin interface.

Namespace

Drupal\session_test\Controller

Code

public function noSet($test_value) {
  \Drupal::service('session_handler.write_safe')
    ->setSessionWritable(FALSE);
  $this
    ->set($test_value);
  return [
    '#markup' => $this
      ->t('session saving was disabled, and then %val was set', array(
      '%val' => $test_value,
    )),
  ];
}