Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Session Reminder

19 sites Security covered Drupal 9–11
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.

Depends on

Dependencies of the latest stable release

  • user Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
4
Tracked since
Dec 2024
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 4
Maintenance
Dormant

Release Timeline

Releases

Version Type Core Release date
1.0.3 Stable 9–11 Apr 29, 2025
1.0.2 Stable 9–10 Dec 5, 2024
1.0.1 Stable 9–10 Dec 2, 2024
1.0.x-dev Dev 9–11 Dec 1, 2024