Instant panel logout

panel

#1

Hi,

after developing my current project on my local machine, I deployed everything on a live server (protected by a .htpasswd file), so some other people could test the front end.

The Kirby installation is located in root/beta and the site’s URL is beta.domain.com
SSL is activated.

I have separated panel users (default Kirby users) and front end users (using the excellent lcd344/userManager plugin).
The front end part is running and behaving like expected.
The panel part, however, is buggy. I can log in and see the panel, but whatever I do next, I’m redirected to the panel/login page and thus I have to log in again.

Does anyone recognize this problem or have a possible solution for me?
Thanks


#2

There may be different reasons, maybe one of the existing post for this topic can help: https://forum.getkirby.com/search?q=panel%20logout


#3

Believe me, I’ve read and tried them all already but can’t seem to find the cause/solution :disappointed_relieved:


#4

Is there anything in your server logs that may shed some light on this?


#5

It seems like I have fixed the problem.
I thought that writing

c::set('ssl', true)

in my config.php would suffice to force https being used.
I’ve added

# force https
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

to the .htaccess file and am no longer being logged out from the panel.


#6

As I understand it this tells Kirby to generate https urls for things like image src urls, page links, file links etc. It does not force the server to use https. The best way to do this is here on Kirby Secrets.


#7

The best way to do this is in your server config file (if you have your own server). .htaccess is only second best.


#8

Thanks for the info, I didn’t realize that!

@texnixe sadly it’s not my own server!


#9

Sure, but i figured @Shurugaz most likely had shared hosting, and would not be able to change the server config at that level.


#10

So, the problem reappeared and didn’t go away anymore. One detail: it only happened in chrome.
After hours of searching a possible solution, I finally found it. I’m posting it here in case someone else is experiencing the same issue:

TLDR: a missing favicon.ico might cause panel session problems in Chrome. Add a favicon.ico and your troubles might be (mine were) gone instantly.