Help troubleshooting sessions

Help troubleshooting sessions

by David Borges -
Number of replies: 4

Hi guys,

We have moodle version 4.5.1 installed in a debian server, we were previously using dbsessions, but we switched to file sessions  following the official documentation present in https://docs.moodle.org/405/en/Session_handling#Use_database_for_session_information and noticed that the sessions were being saved to both the sessions folder and the database sessions table.

Is this normal? What can we do to prevent the sessions from being saved  to the database?

Average of ratings: -
In reply to David Borges

Re: Help troubleshooting sessions

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Are you sure that the sessions are being stored to the database? I think you'll find that they are not. Only the session identifier is stored in the table if you are not using db sessions. And that is normal.

I've said this a few times recently, but I would strongly recommend you consider moving to Redis for sessions.
In reply to Howard Miller

Re: Help troubleshooting sessions

by David Borges -
Dear @Howard MIller.
Thanks for the clarifications. We're considering using redis for sessions but needed to fix session timout issues. The confusion standed for the fact that in a new installation the sessions table is not created but in an existing one using db sessions and then switching to file sessions the sessions table kept being used.
In reply to Howard Miller

Re: Help troubleshooting sessions

by Eduardo Kraus -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Regarding sessions, check the mdl_sessions.sessdata column, and you will see that the data is stored in this table.