class SessionTestHooks
Same name and namespace in other branches
- 11.x core/modules/system/tests/modules/session_test/src/Hook/SessionTestHooks.php \Drupal\session_test\Hook\SessionTestHooks
Hook implementations for session_test.
Hierarchy
- class \Drupal\session_test\Hook\SessionTestHooks
Expanded class hierarchy of SessionTestHooks
File
-
core/
modules/ system/ tests/ modules/ session_test/ src/ Hook/ SessionTestHooks.php, line 13
Namespace
Drupal\session_test\HookView source
class SessionTestHooks {
/**
* Implements hook_user_login().
*/
public function userLogin(UserInterface $account) : void {
if ($account->getAccountName() == 'session_test_user') {
// Exit so we can verify that the session was regenerated
// before hook_user_login() was called.
exit;
}
// Add some data in the session for retrieval testing purpose.
\Drupal::request()->getSession()
->set("session_test_key", "foobar");
}
}
Members
| Title Sort descending | Modifiers | Object type | Summary |
|---|---|---|---|
| SessionTestHooks::userLogin | public | function | Implements hook_user_login(). |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.