Session expired - please login

Your software
My Mautic version is: 3.1.2
My PHP version is: 7.2
My Database type and version is: MariaDB 10.3.27

Your problem
My problem is:

Hi,
During my mautic session work, I need to leave for some other tasks, but often I leave mautic in the middle of a task, for example I’m setting up a campaign inside the campaign builder, then I leave mautic and do some stuff, then I return to my campaign and whenever I click something it says: " Session expired - please login".

It’s sometimes very frustrating and not very productive, since I choose every time the option " keep me logged in" on but it seems to not having an impact.

Is there any solution to this please ?

Which browser and is in incognito mode ?

I’m using Chrome Version 88.0.4324.190 (Official Build) (64-bit) with normal window mode

I can’t tell if the probleme is related to version 3 or to cpanel softaculous installation procedure.

Cause today, and for testing purposes, I installed version 2.15.3 using .zip file, and after some time of mautic dashboard (v2.15.3) being out of focus it stays perfectly connected and didnt trigger the “session expired” message.

This question came up in yesterday’s mautic help desk hang out with @joeyk @DavidSchargel

I was able to increase my session duration by edit the php.ini file.

My mautic is in a sub domain on a shared host so I did not have a php.ini file. I asked my host to make one for me but I believe I could have easily done it myself and placed it in the root directory of the subdomain.

Then I added
session.gc_maxlifetime = 2000
to the that file

So far so good, I have not been logged out. U could increase the session duration by increasing the number of seconds.

Simply put, the session duration is governed by your PHP settings and not by Mautic.

7 Likes

Later edit
it seems that the “remember me” checkbox works properly since 4.4.1: https://github.com/mautic/mautic/pull/11363

Later later edit
the cookie does not work properly with Froala Editor. The File browser to insert an image (elfinder) comes with an error (401 unauthorized). See more here: Checkbox "remember me" (cookie): Elfinder: 401 unauthorized error

Old post content
I hoped the issue is solved in the new version of Mautic (4.4.8) - but no, the bug is still present. Does anyone know an “out of the box” solution, that comes with Mautic, without being necessary to add some JS-code in the app.js or change the php.ini or …?

This subject was discussed also here:

The solution I use:
I add this line of code to keep me logged in:
jQuery(function () {setInterval(function(){jQuery.ajax({method: 'GET',url: 'https://m.ionutojica.com/s/credentials'});}, 9 * 1000 * 60);/*every 9 minutes*/});
at the end of media/js/app.js. But as soon as the browser restarts, I need to login again.