Your software
My Mautic version is: 3.3.2
My PHP version is: 7.3.27
My Database type and version is: MySQL 8.0.19
Your problem
My problem is: The “keep me logged in” option on the login screen doesn’t make any difference, we are still logged out of the UI after around 30 minutes of inactivity.
These errors are showing in the log: There is no error, it just doesn’t maintain the login.
Steps I have tried to fix the problem: None
Is this a known issue or is it directly related to our specific setup? We are using the Mautic Docker container (Docker Hub) behind an Apache reverse proxy.
This indeed is a frustrating this. I have seen a post in the past but to be honest have not implemented it for any of my instances. Give it a try and see if it works:
Go to Settings->System Info and check what version of php you are running
Go and edit the php.ini file, usually found in /etc/php/7.3/fpm/php.ini. [I would make a backup of the file first]
Search for the string session.gc_maxlifetime = 1440 and change to 3600
Restart your php fpm service: sudo systemctl restart php7.3-fpm
That solution seems to work for some and not for others. My host applied those changes for me and when he tested on his side he stayed logged in using my credentials.
On my side, using the same credentials I am logged out after the usual short period. So there seems to be some local setting that overrides the session.gc_maxlifetime setting
Thanks @mikew I’ve made that change, not quite the same way as I’m running Mautic on a Docker container, but I can see that the session.gc_maxlifetime value in the System Info > PHP Info has changed from 1440 (24 minutes) to 86400 (1 day) which will hopefully work.
Also, it feels like whoever set this “default” in PHP got confused between seconds and minutes as setting the session time out to 1440 seconds seems an odd value to select, I guess they where thinking 1440 minutes, e.g. 1 day, but once you have set a default value and it’s “out in the wild” its hard to change it I guess…