MDL-66151 Performance: Session Manager modularisation

Storage of session metadata has moved into the session handler class.
This allows for other classes to fully control session handling and
removes the dependancy on the core sessions database table.

Previously, the standard method of interaction with the
session metadata was direct DB calls; this may break other plugins as there
are now proper APIs available through the session manager.

Co-authored-by: Darren Cocco <[email protected]>
Co-authored-by: Trisha Milan <[email protected]>
Co-authored-by: Andrew Nicols <[email protected]>
This commit is contained in:
Trisha Milan
2024-09-03 13:04:04 +10:00
committed by Matt Porritt
co-authored by Darren Cocco Andrew Nicols
parent 072fb90384
commit e52fbd2f84
30 changed files with 1408 additions and 700 deletions
+2
View File
@@ -87,6 +87,7 @@ class auth extends base {
$new = implode(',', array_flip($plugins));
add_to_config_log('auth', $CFG->auth, $new, 'core');
set_config('auth', $new);
\core\session\manager::destroy_by_auth_plugin($pluginname);
// Remove stale sessions.
\core\session\manager::gc();
// Reset caches.
@@ -160,6 +161,7 @@ class auth extends base {
$value = implode(',', $auths);
add_to_config_log('auth', $CFG->auth, $value, 'core');
set_config('auth', $value);
\core\session\manager::destroy_by_auth_plugin($this->name);
}
if (!empty($CFG->registerauth) and $CFG->registerauth === $this->name) {