Login to panel issue

Sometimes when I try to login to the panel on localhost or even on a live server, I get this problem.

I write username and password and click ā€œLog inā€. The fields will be cleared but thatā€™s it. Nothing more happends.

  • It does not always happen. It appears to be random. Sometimes it just happends. It usually happends every two days.
  • It seems to have something to do with sessions, because when I try again it still does not work. In another browser where the session is not yet set it works.

Is it a known issue? Anyone else seen this?

I tried to find a Google Chrome extension that cleared the session of the current tab, but I could not find any.

Does it only happen in one browser? Have you tried disabling all Chrome extensions? If you do so, does the problem persist?

There are definitely some glitches in the very recent versions of Webkit. Ive had some frustrating problems lately that go away if I use Firefox. This is annoying because I like Opera as my main browser. Does your issue only happen in webkit based browsers (Safari, Opera, Chrome)?

My current major issue is that about a week ago, I cant view any website on my local system served with Valet and launched via command line (Laraval Mix) through a browser sync proxy. (The proxy works but hitting the site directly does not work). I think theres a hideous bug in Webkit to do with Javascript. Everything works great with Firefox. Vivaldi works too.

@texnixe

To test it I need to use Firefox, or Chrome without extensions for like 2 days. I have not done that.

@jimbobrjames

I did not put 2 days of effort to test it out. But if you have some problems as well itā€™s at least a possibility that it has something to do with Webkit.

For me, it doesnā€™t sound if the two issues here are related.

Iā€™d like to ask you, @jenstornell, to test if it works in another - preferably fresh - browser. I have never had issues logging in to the Kirby Panel in any of my browsers on Mac, and therefore canā€™t reproduce this.

Would be interesting to know if you only have this issue with the Panel - or with logging into other accounts as well.

Maybe if others have the same issue when trying to log in, we can collect more information.

It works well in all fresh browsers, even Chrome. I donā€™t have this issue on any other login like Github, Gmail, Stackoverflow, Kirby Forum, Slack etc.

One thing I can say is that this problem always seems to appear after being logged out. The panel throws me out after a few hours. Then when I try to login it works most of the times but sometimes this happends and then Iā€™m ā€œlocked outā€ for the rest of the day in Chrome at least.

Maybe related to this issue? Bug or not on session_destroy?

Maybe. Sessions is clearly not my strongsuit. When I get this problem I will just run Firefox for the Panel for now. Hopefully me or someone else can provide more info about it in the future, or it will solve itself by Webkit Xampp or something else.

Maybe you can provide some more information about your environment. You say it happens both remote and local, right? Your local environment is Xampp on a Windows machine, Chrome Browser Version/extensions? I currently donā€™t have a Windows machine but should get a new one next week or so.

Your local environment is Xampp on a Windows machine, Chrome Browser Version/extensions?

Yes.

Right now I have these extensions:

  • Awesome Screenshot App 1.0.7
  • Dokument 0.10
  • Google Dokument Offline 1.4
  • Google Hangouts 2017.420.419.1
  • Google Inbox Checker (Inbox by Gmail) 1.0.16
  • JavaScript Errors Notifier 3.1.2
  • JSON Formatter 0.6.0
  • Kalkylark 1.2
  • LastPass: Free Password Manager 4.5.0
  • List Layouts for Trello 3.1
  • Minimalist Markdown Editor 3.4.1
  • Postman 5.4.0
  • Presentationer 0.10
  • r3fresh 0.0.7.0

My girlfriend also have had this problem, but that was on a live Linux server/website. So itā€™s not bound to a local environment and not bound to my computer. She also uses Windows. We often work together like this, that I code and she write the content text.

Does last pass try to fill in your Kirby password? What happens with another user account that Last pass knows nothing about?

Hint (nothing to do with your issue): I use a neat little desktop app for Hangouts, so you can at least get rid of one extension :slight_smile:

What about antivirus / anti malware stuff? Have you got anything that might interfere? Some firewall and anti virus tools have browser extensions to warn you about malicious sites. Perhaps thats interfering?

Is your internet connection clean? No VPNā€™s, gateways, proxies or anything?

Just a wild idea, but the developers i used to work with used Fiddler to see the data back and forth between browser and server. Maybe that will help? Might show whats getting in between you and the server and preventing login. Donā€™t ask me how to use it :slight_smile:

I dont know if my problem is related to yours - but i fixed ā€šmyā€˜ problem with a ssl certificate on my local mamp installation. Iā€˜d the same problemes and no error messages like you. But with a self signed ssl certificate it works right know in all Browsers.

1 Like

Iā€™ve been having the same problem on a live site and Iā€™m trying now to sort out the cause. When I sign in with (correct) username/password, the page just reloads /panel/login but if I sign in with incorrect credentials, I do get a red error message on the page. That leads me to think itā€™s a redirect issue or something with a session not being set properly.

Iā€™ve tried removing custom htaccess rewrites, tried other browsers, tried with/without SSL in the URL, with/without SSL being forced in the config, and gone so far as to (finally) add a LetsEncrypt SSL cert to the live site to be sure it wasnā€™t a bad cert.

1 Like

Ok, I think I got it.

I think existing user account files (/sites/accounts/*.php) need the line role: admin added to them.

Hereā€™s what I did to figure that out:

1.) Made a new folder x in /site/accounts and moved all *.php files into it
2.) added c::set('panel.install', true); to /site/config/config.php
3.) went to https://[SITENAME]/panel and created a new account.
4.) compared the new [NAME].php to the existing /site/accounts/x/[NAME].php

The newly created account file had an additional line: role: admin which was absent from the existing one.
So, I went through all the *.php files in /site/accounts/x/ and added role: admin

Then, I deleted the new [NAME].php file and moved the existing account files in /site/accounts/x/ to /site/accounts/

When I signed in again, it worked as expected.

1 Like

While your users have to have a role, it doesnā€™t have to be the admin role. The default roles are admin and editor, but you can define your own roles as well.

How did you create your users so that the role was missing?

The site has been running for a couple years, so I think the role: * probably got added to the config system later. (I donā€™t see anything about it in the docs.)

Maybe a test could/should be added to check if thatā€™s missing and throw a display error or assume a specific role. Maybe thatā€™s already in there. It could have been something else of the panel install process that fixed the issue, but that was the only change I could spot.

@maxfenton Ok, I can reproduce your issue with the missing roles. However, the problem with missing roles is not related to the problem described by @jenstornell, where the issue of not being able to log in to the Panel only happens intermittently. But itā€™s good to know, anyway.

The role is added when a user is created via the Panel. If the role is missing, the user was probably created some other way, manually or programmatically. Or maybe roles didnā€™t exist prior to Kirby 2, canā€™t remember.

1 Like

I really like all the research that does into this issue, but Iā€™ve checked my user role and itā€™s set to admin in the user file. So in my case itā€™s the same cause.

I can also confirm that the redirect problem only appear when the username and password is correct. Else an error is thrown.

A post was split to a new topic: Error when trying to log in to Panel