Login session lifetime extending for the frontend

From frontend logged user after 10-15 minutes away, logout automaticly. How to extend this time to increase?


You can set panel.session.lifetime and panel.session.timeout in config.php options.

1 Like

This is about frontend login not panel. Does work?

That would be the following code:

s::$timeout = 120; // two hours of session validity like in the Panel
s::$cookie['lifetime'] = 0; // don't let the cookie ever expire

Use it before the session gets initialized (for example in the config file).


Adding these two lines seems to have no effect (with Kirby 2.2 or 2.3). The kirby_session and kirby_session_auth cookies both continue to have an Expires / Max-Age of Session.

Boosting the lifetime value to 4200 instead of 0, however, does change the expire date of both cookies to something like 2016-07-01T07:29:44.414Z. The weird thing is that users still get logged out within a day, despite both cookies still being present with those faraway expiration dates.

I’m a bit perplexed as to why this is happening. Logging out manually deletes the kirby_session_auth cookie and hides any user-only content as you’d expect, but content still gets hidden if the user just waits a while, even though the kirby_session_auth cookie is still present in their browser.

Is there something other than the presence of the cookie that determines whether someone is logged in/out? Has anyone else gotten this working?

The solution does not seem to work. I have the following in my config.php:

s::$timeout = 60*24*30; // thirty days of session validity like in the Panel
s::$cookie['lifetime'] = 9999999; // don't let the cookie ever expire

Cookie lifetimes are set accordingly.
Nonetheless I still have to login every few hours…

Any hints? Daniel

I would also like to know any solution. I have a webshop where customers have to login to view products, but it seems like they are logged out in under 30 minutes.

Please see this topic. Discussion continues there.