function session_test_user_login in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/system/tests/modules/session_test/session_test.module \session_test_user_login()
Implements hook_user_login().
File
- core/
modules/ system/ tests/ modules/ session_test/ session_test.module, line 6
Code
function session_test_user_login($account) {
if ($account
->getUsername() == '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");
}