Forced Panel Logout on Media Temple

When I upload my site to live server, I am constantly logged out of the panel within 10s to a few minutes. When the same code is on my local installation, there doesn’t seem to be an issue. I tried the solution shown here (Panel keeps logging me out), but it doesn’t seem to be working for me.

Here is the code snippet I added to my config.php file

if (c::get("debug") == true) {
    s::$fingerprint = function() {
        return sha1(
            kirby()->roots()->index().
            visitor::ip()
        );
    };
}

I am using different user accounts to control access to certain parts of the site. Would that affect this at all? Also wondering what would happen if I remove the if statement, since none of the others bits of code in the config.php file seem to have this. Thanks in advance!

Also, my site is running Kirby 2.4.1.

First of all I’d remove the if-statement, don’t know why that is there. Let me know if that changes anything.

That doesn’t seem to do anything. I tried both of these snippets:

c::get("debug") == true {
    s::$fingerprint = function() {
        return sha1(
            kirby()->roots()->index().
            visitor::ip()
        );
    };
}

and

    s::$fingerprint = function() {
        return sha1(
            kirby()->roots()->index().
            visitor::ip()
        );
    };

I’m also not sure what the kirby()->roots()->index(). is actually doing…

kirby()->roots()->index() returns the document root of the website.

Does it make any difference if you use a fixed string like this:

   s::$fingerprint = function() {
        return 'hello';
    };

(only do this for testing).

The other question is in what way your server environment is different from your localhost installation.

I tried using this, but after a few minutes, I saved the page and I was kicked back to the login.

I’m not sure how my host differs from my local environment. I’m hosted on a MediaTemple Grid and I run the localhost through MAMP.

I just found this: https://mediatemple.net/community/products/grid/204643480/why-am-i-experiencing-session-errors

Maybe it helps.

2 Likes

So far the solution in that support article seems to be working! I changed the title to be a bit more descriptive for anyone that might come across the same problem. Thanks!