By znerol on
Change record status:
Draft (View all draft change records)
Project:
Introduced in branch:
main
Introduced in version:
12.0.0
Issue links:
Description:
SessionManager::destroy() is deprecated in Drupal 12.0.0 and is removed from Drupal 13.0.0. Use Symfony\Component\HttpFoundation\Session\Session::invalidate() instead.
Before:
function user_logout(): void {
// [...]
\Drupal::service('session_manager')->destroy();
// [...]
}
After:
function user_logout(): void {
// [...]
\Drupal::requestStack()->getSession()->invalidate();
// [...]
}
Impacts:
Module developers