You are here

public function SessionTestController::setMessageButDoNotSave in Drupal 10

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

Sets a message but call drupal_save_session(FALSE).

Return value

string A notification message.

1 string reference to 'SessionTestController::setMessageButDoNotSave'
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 127

Class

SessionTestController
Controller providing page callbacks for the action admin interface.

Namespace

Drupal\session_test\Controller

Code

public function setMessageButDoNotSave() {
  \Drupal::service('session_handler.write_safe')
    ->setSessionWritable(FALSE);
  $this
    ->setMessage();
  return [
    '#markup' => '',
  ];
}