By Michael


2018-06-29 09:02:02 8 Comments

When I put site in maintenance mode and after turn site back all users sessions are not active (is need to log in account), but I put session to work 2 month and it work.

How to prevent users logout when put site in maintenance?

1 comments

@quex 2018-06-29 15:14:37

This is intended behavior, if user does not have "access site in maintenance mode" permission, then user is logged out.

For Drupal 7 take look on user_menu_site_status_alter

For Drupal 8 take look on Drupal\user\EventSubscriber\MaintenanceModeSubscriber

@prkos 2018-06-29 16:31:11

The question was about losing sessions after the Maintenance mode is turned off, not during it.

@quex 2018-06-29 18:26:40

Yes, this is the reason why the session is destroyed - the logged-in user visits the website which is in maintenance mode. The user who visits the website after the maintenance mode is turned off will not be logged out.

@Elijah Lynn 2019-05-10 16:35:01

Thanks for linked to the code here. This is shocking behavior, does anyone know if there were technical reasons behind doing this? Users lose all content they were working on if they hit "submit" or refresh the form they were working on. I am looking for some discussions around this to understand the "why" a bit better.

Related Questions

Sponsored Content

1 Answered Questions

[SOLVED] hook for maintenance mode

  • 2018-05-17 10:13:28
  • shasi kanth
  • 64 View
  • 2 Score
  • 1 Answer
  • Tags:   7 maintenance-mode

2 Answered Questions

1 Answered Questions

[SOLVED] Site stuck in maintenance mode

  • 2011-03-03 12:12:22
  • kiamlaluno
  • 10046 View
  • 15 Score
  • 1 Answer
  • Tags:   maintenance-mode

3 Answered Questions

1 Answered Questions

[SOLVED] Error message when deleting folders/files on Maintenance mode

1 Answered Questions

[SOLVED] Anonymous view while developing without quit maintenance mode

  • 2014-07-17 20:25:02
  • svelandiag
  • 146 View
  • 2 Score
  • 1 Answer
  • Tags:   7 maintenance-mode

2 Answered Questions

[SOLVED] Cannot login to turn off maintenance mode after 7.24

1 Answered Questions

[SOLVED] Maintenance mode doesn't work on front page without www prefix

1 Answered Questions

[SOLVED] Site turned to maintenance mode without changing any settings

  • 2011-07-21 14:07:48
  • chrisjlee
  • 1159 View
  • 1 Score
  • 1 Answer
  • Tags:   6 maintenance-mode

Sponsored Content