Long sessions for Kirby 2

Greetings!

We have multi-language website, and we use session to store users preferred language. All works fine untill browser is closed. Apparently, we loose session on browser close.

I found settings to prolong session in documentation here:

Sessions | Kirby CMS

which is written for version 3. How do I setup session timeout and lifetime in version 2?

PS. Sessions | Kirby CMS contains broken links i.e http://getkirby.test/docs/reference/system/options/session#durationnormal

Long sessions for frontend users with $user->login() method?

No, for regular visitors. No-auth users

Hmm

Long sessions are a new feature in Kirby 3. Our old session implementation in Kirby 2 relies on PHP sessions, which are unreliable when used with a long duration (PHP will sometimes clean them up before).

You can extend the duration like explained in the thread @ahmetbora linked to, but it‘s not going to be as reliable as the v3 implementation. The better alternative for your use-case is a simple cookie, which can have any duration you want.

Thanks for letting us know about the broken links, they are now fixed.