Error "flush_sessions_not_supported" when trying to Logout All Users in MODx 3

In MODx 3.0.3 (and 3.0.2) when clicking on Logout All Users I get an error message saying “flush_sessions_not_supported”.

This site is an upgrade from 2.8.4 where the Logout All Users works properly.

Do you use the default session handler or a custom session handler class?

There are a couple of related pull requests that may solve the issue:

Maybe try them out.

I see this too on all my MODX 3 sites now that you mention it. Sites upgraded from 2.8.x and sites that were MODX 3 from the start.

UPDATE:

Having said that I’ve just found a site where it doesn’t happen. But it’s there on most of them. I’ve never used a custom session handler.

What’s the value of the system setting session_handler_class?
Is it MODX\Revolution\modSessionHandler in all cases?

In the sites that have the issue - that setting is set to modSessionHandler

In the one site that I’ve found so far without the issue - it is MODX\Revolution\modSessionHandler

I’ve never knowingly changed that setting so I guess there must be an extra messing with it?

It’s probably just another case of a setting, that’s forgotten to be updated when you upgrade from MODX 2.x to MODX 3.

1 Like

Did changing the setting fix the sites for you?

After my upgrade the Session Handler Class Name was just modSessionHander, but has been changed to be MODX/Revolution/modSessionHandler

The problem still exists though.

I attempted to apply both of the fixes separately, and neither one fixes the problem. The first one does remove the error message though. It just doesn’t log anyone out. Fix bugs with extending the session handler class by sergant210 · Pull Request #15934 · modxcms/revolution · GitHub

Strangely I just noticed that when the session handler is set to MODX/Revolution/modSessionHandler I start seeing lots of identical errors in the logs saying:

(ERROR @ /ROOT/core/vendor/xpdo/xpdo/src/xPDO/xPDO.php : 666) Could not load class: MODX/Revolution/modSessionHandler from modx/revolution/modsessionhandler

When changing it back to plain modSessionHandler then the errors go away.

Hey @pixelstuff

Just tried switching the setting to MODX\Revolution\modSessionHandler and got the same results as you:

  • the flush_sessions_not_supported error persists
  • Lots of Could not load class: MODX/Revolution/modSessionHandler from modx/revolution/modsessionhandler errors in the Manager Error Log.

Those HAVE to be backlashes, not forward slashes. This should be the default on any MODX 3 sites that were not upgraded. It SHOULD also be updated automatically when upgrading from 2.8.x. If that is not the value after the upgrade, that needs to be reported.

Otherwise, with the value set properly, it works perfectly in my testing here; you should not need to change that setting. So there is something fishy going on here.

3 Likes

LOL :person_facepalming:

Good spot …

MODX\Revolution\modSessionHandler

… fixes the problem - but as far as I can see that system setting is NOT updated when upgrading from 2.8.x to 3 on any of my sites.

1 Like

Ooof. A quick search through the upgrade scripts confirms this is not being updated. I will submit a PR to fix this for next release.

1 Like
1 Like

Ahh. Those back slashes fixed the problem. It got rid of the errors and allowed the system to log everyone out properly.

2 Likes