Use Drupal/Symfony session instead of $_SESSION

Created on 1 January 2023, over 1 year ago
Updated 21 January 2023, over 1 year ago

Problem/Motivation

saml_sp_drupal_login.module has several references to $_SESSION left over from its 7.x days. Drupal 8 and later recommend using \Drupal::service('session') instead.

Proposed resolution

MR attached to this issue updates the code, and includes two additional pieces of data available at authentication time (the IdP and its session index) for use in logout code such as πŸ“Œ Enabled hook_user_logout functionality Needs work .

API changes

It’s possible some code external to this module also relies on $_SESSION['authenticated_via_saml_sp'], so I preserved it but left a reminder to remove it at our next major version.

Data model changes

Three new keys in the session:

  • saml_sp__authenticated
  • saml_sp__idp
  • saml_sp__session_index
πŸ“Œ Task
Status

Fixed

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jproctor

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024