Can't log in to panel

@eriks What is your Kirby version? Did the problem just pop up as well on a site that worked perfectly fine before?

I can’t remember, it’s just for a second. I use Chrome and do a hard reload at the login.

It’s the latest Kirby version.

The error message points to this code:

 // delete all file contents first
        if (rewind($handle) !== true || ftruncate($handle, 0) !== true) {
            // @codeCoverageIgnoreStart
            throw new Exception([
                'key'       => 'session.filestore.unexpectedFilesystemError',
                'fallback'  => 'Unexpected file system error',
                'translate' => false,
                'httpCode'  => 500
            // @codeCoverageIgnoreEnd

in the FileSessionStore class.

But now we have three people with problems one overnight, which is really weird and I’m pretty sure that means they have changed something and should fix it.

yeah, same for me, they said nothing changed. Which can’t be true, as @texnixe said three people suddenly facing issues overnight, not having changed anything, is pretty unusual. I am still waiting for the tech staff to get back to me. Up until now I have only been talking to customer support.

I was just planning to move another site to their servers, luckily up until now I’ve been too lazy to do it…

just a wild guess. minor upgrade of php version with slight „optimizations“ in file handling…

order of call to rewind followed by ftruncate seems to be important AND since used with an or-statement NOT as suggested in the docs. rewind should be called after ftruncate.

The error seems to be fixed:


(“thank you for your patience. The error should be fixed. It was caused by a missing module.”)

Indeed, I can finally log in again.

@eriks, is this the case for you as well?


We haven’t changed anything

So much for that.


Yep, its alright now :slight_smile: phew

1 Like

Works for me as well now

@Eduard Good to know, thanks for your feedback.


It seems like I’m having the same issue as the folks on this thread.
I didn’t change anything but the panel won’t log me in (or other users). The site is hosted on AWS LightSail, running 3.2.3 on php ver 7.1.28.

I also looked at the other thread. Removing session files didn’t help (there were about 20 session files), and it looks like cookies are not the issue either. What’d be the best way to move forward from here?

You should consider updating…we are currently at 3.4.

Apart from that, are there any errors in your php or server error logs or in the browser console?

Console looks like this – do you think updating the version to 3.4 would help?

Thank you. According to the error message, this is an issue with the CSRF token. Did you newly deploy the site or did the issue suddenly come up?

It just came up suddenly. The recent updates to the site have been all in the contents folder…

Have you tried to delete all stuff from the session folder?

Could it be that the provider changed things?

Yes, I deleted all the things from the session folder. Kirby is installed on a Lightsail’s default LAMP (bitnami) instance, and I don’t think AWS changes anything on these instances…?

Belated answer to myself:
It turns out, the server storage was completely full, which caused the issue. Moved the site to a new instance with bigger space, works like a breeze. Thanks again!

I keep hitting the same issue albeit only with Firefox. I often don’t bother to log out but close the tab instead and the next time I go to /panel I get the “invalid CSRF Token” error. Safari and Chrome have no issues, nor does Firefox in incognito mode. I can’t hard reload the login window either - I get a 500 error - nor navigate directly to /panel/login, so adding these URLs to Firefox’s exceptions lists doesn’t have any effect.