I have never had this with older versions of EE but I just began working with the latest version, 4.3.6, and I keep getting automatically logged out of the control panel after saving changes to templates. I will click Save and wind up back at the login page. Sometimes when I attempt to log back in without refreshing the login page I get an error message "error: this form has expired. please refresh and try again."
I have found the proposed solutions to this problem for versions 2.X and have tried them but they have not worked. I have not seen any solutions specifically for the latest version.