Nondeterministic redirects

Kirby redirects users from the panel to the login page seemingly nondeterministically. It happens sometimes but not others. Sometimes you can log in and go to a view in the panel, other times not. Sometimes when you go to a view and try to make an edit, you are redirected to the login page. When I run the same app locally under MAMP I do not have this issue. It only occurs in production.

I’m running kirby behind apache inside a docker container, managed by kubernetes.

Things I have tried to no avail:

  • turn off debug mode
  • set RewriteBase to / in .htaccess
  • chmod 0755 -R /var/kirby/project/folder
  • chown -R www-data:www-data /var/kirby/project/folder


What browser are you using?

Chrome, but I just tested and the problem also occurs in safari.

When you are force logged out, it means that the session is lost. There may be several reasons for that. Does the container restart when this happens? The session cookie may get lost, the session may expires for some reason or session data is lost on the server. Is there anything in the server error logs that may give a hint? Or any errors in the console?

My best guess is Kubernetes was directing subsequent requests to different instances of the website. I’m avoiding this altogether by deploying kirby on its own machine, since containers seem to be the root of all of my problems :slight_smile:

Yep, sounds like it. This will also solve your user management problem.