Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

Session Reminder

15 sites Security covered
View on drupal.org

This module displays a modal to authenticated users before their session expires, allowing them to extend it with a click. Administrators can customize the modal's appearance and choose which user roles will see the notification.

The Session Reminder module for Drupal displays a modal before a user's session is about to expire, allowing them to extend their session duration and prevent logout.

Features

  • Pre-Expiration Notification: A modal window alerts users before their session expires.
  • Session Extension: The modal includes a button that updates the session cookie's expiration time based on the cookie_lifetime value.
  • Customizable Design: Administrators can configure the modal's appearance, including border-radius, background color, button color, and text color.
  • Role-Based Visibility: Administrators can define which user roles see the modal (authenticated users only).
  • Graceful User Experience: The modal is designed to minimize disruption to the user's workflow.

Installation

To install the Session Reminder module:

  • Download the module from the official Drupal repository or using Composer:
    composer require drupal/session_reminder
  • Enable the module via the Extend page (/admin/modules) or by running the following Drush command:
    drush en session_reminder -y
  • Clear the site cache to apply changes:
    drush cr
  • Once enabled, access the configuration page at /admin/config/session-reminder to set up the module.

Configuration

Configure the module at /admin/config/session-reminder or via the admin menu under "Configuration > People > Session Reminder."

Functional Settings:

  • Warning Threshold: Set how many seconds before session expiration the modal should appear.
  • User Roles: Choose which roles will see the modal notification.

Style:

Take advantage of the live preview feature in the style tab to customize the modal's appearance in real-time. As you make changes, the preview will update instantly, allowing you to see how the modal looks with the selected styles. This makes it easier to refine the design to match your preferences or platform requirements.

The following style options are available for customization:

  • Modal Background Color: Adjust the overall background color of the modal window.
  • Modal Title Color: Change the color of the modal's title text.
  • Modal Text Color: Customize the color of the body text inside the modal.
  • Submit Button Background Color: Set the background color for the submit button.
  • Submit Button Text Color: Define the color of the text displayed on the submit button.

With the live preview, you can experiment freely and achieve the perfect look for your modal in a seamless and efficient way.

The module uses the cookie_lifetime value from Drupal's services.yml file to calculate session duration.

  • cookie_lifetime: Defines the session cookie's validity duration (default: 200,000 seconds, ~56 hours).
  • gc_maxlifetime: Specifies the maximum lifetime of session storage. If set to 0, session data has no expiration, which prevents the modal from functioning correctly.

If gc_maxlifetime is set to 0, a warning will be displayed on the configuration page.

Usage

Once enabled and configured, authenticated users will see the session expiration reminder modal based on the defined warning threshold and roles.

Troubleshooting

  • No Modal Appears: Ensure cookie_lifetime is set correctly and gc_maxlifetime is not set to 0.
  • Check the "Configuration > People > Session Reminder" page for additional information about session settings.

Activity

Total releases
2
First release
Dec 2024
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 2
Maintenance
Slowing

Releases

Version Type Release date
1.0.3 Stable Apr 29, 2025
1.0.2 Stable Dec 5, 2024