Disable autologout on certain pages

Created on 21 January 2025, about 1 month ago

Problem/Motivation

I can't disable autologout on certain pages ('/exam-media/*'). I tried using a custom hook_autologout_prevent, but it is not working.

/**
 * Implements hook_autologout_prevent().
 */
function mymodule_autologout_prevent() {
  $current_path = \Drupal::service('path.current')->getPath();
  if (\Drupal::service('path.matcher')->matchPath($current_path, '/exam-media/*')) {
    return TRUE;
  }
}

Thank you in advance for your help and solution.

๐Ÿ’ฌ Support request
Status

Active

Version

1.0

Component

Miscellaneous

Created by

๐Ÿ‡ต๐Ÿ‡ฑPoland adpo

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

Comments & Activities

Production build 0.71.5 2024