Strange "maintenance" behaviour on multisite

I found an strange behaviour on multisite, when is enabled maintenance mode.

Steps to reproduce:

Create 2 sites

  1. site 1 with theme1 - on main www.example.com
  2. site 2 with theme2 - on subdomain user.example.com

On site 1 enable maintenance
On site 2 (in default mode) is maintenance enabled too but picked maintenance html is not pointing to site1 theme1 but site2 theme2 …

When visited site 2, cms is looking for maintenance template and ignoring that users is backend authenticated (probably due to subdomain) that means, it returns 404 for maintenance template.

workaround is enable multisite on maintenance, to separate, but this is not a gooood way how to handle subdomains, when you need to share session between main toplevel…

second workaround is to update config/session.php and set domain to ‘.example.com’ (as solution) to share session info about backend user… this will correctly showing page from site 2

2 Likes

Ah yes… likely because the administrator session only exists on the main domain. This is somewhat normal behaviour; your second solution is a good fix.

just, probably, there are some kind of session fight between user (FE) a user (BE) sessions, when i logged out from FE, got logged out on BE too … and (FE) login invalidated tokens on BE as well :confused: probably needed to separate this two sessions to avoid this kind of behaviours

1 Like