CSRF token error when trying to save edited landing page layout

Your software
My Mautic version is: 4.4.10
My PHP version is: 8.0.30
My Database type and version is: 10.6.15-MariaDB

Your problem
I’ve discovered that this CSRF token error appears to be related to how long you go between saves of your work when editing a landing page. I don’t know what the interval is, so I’m saving it after every few small changes. But if I leave it mid-edit to go and do some food, when I come back, it allows me to continue editing but then blow up with a CSRF token error when I try to save it. So I think it’s definitely to do with some kind of timeout, but which one? How can I make it so it will last at least an hour between needing to save it, or setting up an autosave? I see I’m not the first and so I probably won’t be the last - Any ideas though?. There didn’t appear to be a log file that I could find related to this
Thanks in anticipation

This happened to me already when editing emails. When I take too long, I get a CSRF token error when saving. It is indeed a timeout and has to do with the time you remain logged in at the system. There is a checkbox: keep me logged in, but in my experience it did not resolve the CSRF token error.

Try setting session.gc.maxlifetime in your php.ini to something higher than 1440

After this number of seconds, stored data will be seen as ‘garbage’ and
; cleaned up by the garbage collection process.
; PHP: Runtime Configuration - Manual
session.gc_maxlifetime = 1440

And

And session.cookie_lifetime higher
Lifetime in seconds of cookie or, if 0, until browser is restarted.
; PHP: Runtime Configuration - Manual
session.cookie_lifetime = 0

Thanks so much :slightly_smiling_face:

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.