PHP Fatal error when login in the Panel after session expire

Hello nice people, Iā€™m having a weird issue when I login after some period a session expire and I must login again but when I put my credentials Iā€™m having server error, in the PHP logs thereā€™s a line:
08-Sep-2015 14:00:18 Europe/Rome] PHP Fatal error: Uncaught exception 'Exception' with message 'Invalid route' in /mysite/panel/app/panel.php:240

Stack trace:
#0 /mysite/panel/index.php(47): Panel->launch()
#1 {main}
  thrown in /mysite/panel/app/panel.php on line 240
  1. Iā€™m using latest versions present on the master branch.
  2. Thereā€™s a a 3 plugins: cachebuster, feed and minifyhtml.

In my config.php I have:

<?php

c::set('license', '000000000000000000000000);

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

c::set('timezone', 'Europe/Rome');

c::set('kirbytext.video.class', 'video');
c::set('markdown.extra', true);
c::set('smartypants', true);

c::set('routes', array(
  array(
    'pattern' => 'portfolio',
    'action'  => function($uid) {

      $home = url();

      header::redirect($home, 301);
    }
  )
));

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

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

There is an issue on GitHub: https://github.com/getkirby/panel/issues/546, looks the same.

Have you checked if the problem persists if you deactivate the plugins?

Iā€™m not having this issue anymore, without deactivating the plugins.
If itā€™s happen again I will investigate.

Same storyā€¦ it happens every time when session expires.

I was using a special url of CodeKit sitename.local:5757, Iā€™ve solved just using a MAMP Pro url sitename:8888. On remote server thereā€™s no issues :ok_hand: .

I use CodeKit as well, Iā€™ve removed it and hope itā€™ll solve it :smiley:

This is 100% a bug. Check out #546.

I just replied on Github as well. Itā€™s indeed a bug with the old version. My new ā€œdecruftedā€ version has a new routing architecture and the bug isnā€™t reproducible here. Iā€™m now swaying between providing a fix for the old version or wait until the new one is ready. I plan to release a first developer preview this week. What do you think?