Logs don’t show anything. I have used it in different browsers, not sure if it is a web server setting or something inside Mautic. But certain instances I can be in forever and certain after a minute I get this, sometimes even 3 times in a row.
I have the same problem here, on v3.3.1. It seems to happen when I am in the configuration section, which leads me to believe it’s because of the way that section uses a page-within-a-page, via AJAX or an iframe. I might be re-logging in to the sub-page that had been loaded with AJAX/iframe, but the parent page still has my older login token.
Second this, it has haunted my for years with multiple Mautics, different browsers, diff local machines, diff server set ups but the CSRF token issue just follows me around.
I have a workaround that’s effectively fixed this bug in my 3.3.1 installation from March 2021. I don’t see any reason it wouldn’t work in v4.
The hack keeps the Mautic login fresh by using AJAX to fetch a Mautic page every 9 minutes, just short of the 10 minute timeout that plagues many users.
If your sessions are already working correctly, changing the session timeout like this can be useful. However, this won’t fix the problem many installations are having with being logged-out after only 10 minutes of inactivity. Please view the entire topic about this bug at https://github.com/mautic/mautic/issues/9804
I don’t think my code will fix your problem if you are being logged out immediately after logging in. My hack workaround is for users who are logged out after 10 minutes of inactivity. Your issue sounds like something else, more akin to the entire login session being instantly discarded. I’m not entirely clear how Mautic sessions are maintained, but you might check that both the server’s and browser’s time of day are correct.
You aren’t providing enough information for someone to debug this. What about network failures? What about cookies? Have you used your browser’s development console to monitor those things? Sometimes cookies get thrown out or blocked. My workaround won’t work if the network connection is sporadic.
Again, I am not knowledgeable about Mautic’s use of cookies and CSRF tokens. Even if you provide more information, someone else would probably need to get involved.
Hey @markerb - thanks for your response. Yeah I know I am not providing enough info here, I can provide whatever is needed, I just do not know what is required, and from the reponse on the forum, , there does not seem to be too many people that know what is required… I understand you are not the correct person here either… anyway as @joeyk says “maybe we just have to learn to live with this”…
Appreciate your help so far and especially the code you wrote as this is helping with other instances I have