Modx_session table

hi modxers

lots of articles on here about “modx_session” table but i don’t know what it is for. does it record login sessions? we have a test site modx2.8.4 php8 and NO ONE uses it except us, and it had 25 records in modx_session table for a week and now 8977 records. that makes no sense. we have set:

session.gc_probability = 1
session.gc_divisor = 10

in php, and still this flaming table fills up, or not, as it likes. can we disable this feature?. is there any doc on modx site explaining what the table is for and how it can be managed?. it is crazy that we have to spend time monitoring this modx_session table. there are lots of little snippets of info on modx_session in this forum but no fuller explanation of what it is and what it does, and whether we need it or not. we just build small custom designed sites - we don’t “create” special sessions so we care less about that table other than it fills and fills and fills, no matter what we do. any help would be much appreciated.

By default the session data in PHP is stored in files on the server. MODX just stores the same session data in a database table instead.
This can be changed with the system setting session_handler_class.


Maybe you could try to set the system setting anonymous_sessions to No and see if that helps. With this setting session_start(); is not called for every anonymous user of your site.
Just make sure that you really don’t use $_SESSION on your site. (For example $_SESSION is used in FormIt for certain hooks and functionality.)

thanks Harry. and the modx_session table entries are just browser session variables that the modx apps want to ‘save’ so that a continual user session can be maintained, correct? but it also stores login sessions in the .manager control panel?

just now in modx ‘settings’ i removed the “modSessionHandler” value in the “session_handler_class” setting and i’ll check in over the coming days to see if that has stopped the modx_session table growth and that all modx2.8.4 php8 features are still going :slight_smile: .