Hi,
I have a Kirby website running on a test domain and also in localhost – in both copies, all subdirectories are synced.
I can access the panel and also edit pages in various templates, but when I try to access any file in the online copy I get redirected to the login screen. When I try to log in again the error “Invalid CSRF token” appears. In order to successfully log in, I need to completely quit the browser and re-open the website.
In localhost, everything works fine including the file panel screens.
I tried adding a default file blueprint yml, but it didn’t help.
I also tried adding a new admin user and accessing the file admin pages through there, also didn’t work.
Can you please guide me as to how to solve this issue?
Thanks!
That is probably because the session is not terminated properly. Clearing the browser cache should solve this.
-
What is your Kirby version, PHP version?
-
Do you have any plugins/custom code in place?
-
Do you run into the same issue with a fresh Starterkit?
Hi Sonja!
Clearing the browser cache should solve this.
Thanks! I disabled the cache and login worked again.
- What is your Kirby version, PHP version?
Kirby version 3.8.3, PHP version 8.0.24
- Do you have any plugins/custom code in place?
I have some custom routes defined, and I’m using the “colors” palette plugin for color fields. But when I disable these, the issue persists.
- Do you run into the same issue with a fresh Starterkit?
I just installed a fresh Starterkit and the issue is still happening there.
From analyzing the HTTP response, I am getting a 302 redirect to the /panel/login page whenever I try to access a file admin screen.
Thanks for your help!
Hm, could it be that you have an .htaccess file sitting in the root directory that could be responsible for this redirect?
Hm, could it be that you have an .htaccess file sitting in the root directory that could be responsible for this redirect?
My guess is that it’s also something inherent in the server, but I can’t seem to find what it is. The only .htaccess file I see is Kirby’s own. My interim solution is to instantiate a fresh server and migrate all the files to the new one. A bit brute, but will hopefully do the trick…
Just updating that indeed migrating all the files to a fresh server fixed this issue. We may never know exactly what caused this but I am crossing my fingers that this is now solved!
See also this thread: Redirected to login page when editing file in the panel
This was probably it! Varnish was indeed turned on on the previous instance.