Help troubleshooting sessions

Help troubleshooting sessions

David Borges -
回帖数: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?

回复David Borges

Re: Help troubleshooting sessions

Howard Miller -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 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.
回复Howard Miller

Re: Help troubleshooting sessions

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.
回复Howard Miller

Re: Help troubleshooting sessions

Eduardo Kraus -
Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像

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