Problem session timeout

I state that I have already read some discussions about session time, but without reaching a solution to the problem.
The problem is that the login time is too low.
I tried to insert in config.php:

c::set('panel.session.timeout', 9000);
c::set('panel.session.lifetime', 9000);


s::$timeout = 60*24*30;
s::$cookie['lifetime'] = 9999999;

but the same problem.

Thanks for any help or suggestion.

Have you tried with a custom session fingerprint yet? Check out this thread: Get a longer timeout in the panel

For testing, you can use a simple string. For a permanent solution, you should use something unique, have a look at the original fingerprint and try to adapt that in a way that works for you.

I read the discussion, unfortunately I do not understand how to use it.
For example, the fingerprint method where it should be inserted? Maybe in the config.php file?

Then, maybe the fingerprint method also uses my IP address? If so, the IP address sometimes changes, so I would not solve the problem.

This method that does not use fingerprints:
$user = site()->user();
if($user) {
$username = $user->username();
should be entered in config.php?
Also, in place of “user” or “username” I have to enter the username I created during installation Kirby?

Excactly, the code goes into the. config.php. For testing purposes, use a simple string:

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

If that helps, create a unique fingerprint, i.e. one that is unique for each user. If your logouts are due to frequent IP changes, don’t use the IP.

The whole purpose of this custom fingerprint is that it overwrites the native fingerprint (which uses the IP), see also this explanation.

1 Like

It seems to it work.
However, the method of creating finger print is not clear to me.
For example, can I use a text like “Sed ut perspiciatis unde omnis iste natus error”?
rather than: “DH/?@&%fj$K”?

Is there a documentation?

There is no documentation.

The important thing is to understand what is does. The fingerprint should be different for each user, that’s why the original function uses a combination of IP and user agent string. If you only have one user, it doesn’t matter, you can just use a simple string. If you have multiple users, your fingerprint should have a dynamic part, like the user agent, the user name of whatever works best for you.

1 Like

It continues to it work very well, no logout, this is great.
Thank you very much for all the help and explanations.

(I would like to set this discussion as “SOLVED” but I do not know how to do it)