Login on website only reload

I want to use a login on the website and have followed the cookbook " Authentication". But unfortunately the login does not work. When clicking on login, the page is only reloaded. Logging into the panel works, but when I log in to the panel, I can also access the logged in user page, and the logout on the page also works. I checked the code several times. Also, I do not see an error message. Is there something missing? I searched in the forum but found no solution. The accounts I used to login are admin and editor accounts. If any information is missing, I will complete it.
Thank you for your help!

Is the debug setting enabled?
Could you try to add this in your controller:


immediately after

if(r::is('post') and get('login')) {


I just want to be sure your code gets that far.

Thank you very much for your reply!
I have debugging enabled.
I added it to the controller but still only reload. The fields are empty after the reload. I tested it with the added lines with chrome and edge but in both browsers is the problem still there.


I use only german language, all three files have the same name and are in the same folders like in the cookbook. Only in the /site/templates/login.php
my first lines look like this
<?php if(!defined(‘KIRBY’)) exit;
snippet(“header”); ?>

my config.php is


c::set('panel.widgets', array(
  'pages'    => true,
  'newproject' => true,
  'history'  => true,
  'site'     => true,
  'account' => true

c::set('cache', true);
c::set('cache.driver', 'file');
c::set('cache.ignore', array('sitemap'));

c::set('roles', array(
    'id'      => 'admin',
    'name'    => 'Admin',
    'default' => true,
    'panel'   => true
    'id'      => 'editor',
    'name'    => 'Editor',
    'panel'   => true
    'id'      => 'client',
    'name'    => 'Client',
    'panel'   => false

c::set('routes', array(
    'pattern' => 'logout',
    'action'  => function() {
      if($user = site()->user()) $user->logout();

c::set('debug', true);

the url looks like this www. mywebsite .de/login

Please add the page with the form to the cache.ignore.


Now it works with the login page added to the cache.ignore ,
thank you very much! :slight_smile:

I think this should be added to the docs:

1 Like