kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Add an AUTO_LOGOUT_TIME option for session expiry

Open rtibbles opened this issue 4 months ago • 1 comments

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview

The android and desktop-app installers each override Django session settings to keep embedded single-user sessions alive (SESSION_EXPIRE_AT_BROWSER_CLOSE = False, SESSION_COOKIE_AGE = 52560000). Make session expiry a first-class Kolibri deployment option, set by each installer, instead of duplicated raw Django overrides.

Complexity: Medium Target branch: develop

Context

  • platforms/android/app/src/main/python/kolibri_app_settings.py and platforms/desktop-app/src/kolibri_app/django_app_settings.py both set the same two constants; there is no Kolibri option controlling session cookie age today.

The Change

Add an AUTO_LOGOUT_TIME option to kolibri.utils.conf.OPTIONS controlling SESSION_COOKIE_AGE, where 0 means effectively-unlimited. Default SESSION_EXPIRE_AT_BROWSER_CLOSE to False in core settings. The android and desktop-app installers then set AUTO_LOGOUT_TIME = 0 via their deployment configuration and drop their raw overrides.

Acceptance Criteria

  • [ ] An AUTO_LOGOUT_TIME option in kolibri.utils.conf.OPTIONS sets SESSION_COOKIE_AGE.
  • [ ] AUTO_LOGOUT_TIME = 0 maps to the existing long-lived value SESSION_COOKIE_AGE = 52560000 (~608 days).
  • [ ] SESSION_EXPIRE_AT_BROWSER_CLOSE defaults to False in core settings.
  • [ ] The option's default preserves current session behaviour for standard (non-installer) deployments.
  • [ ] The android and desktop-app installers set AUTO_LOGOUT_TIME = 0 via their deployment configuration and drop their raw session overrides.
  • [ ] The dead from __future__ lines in the android copy are removed.
  • [ ] The new option is documented alongside the other OPTIONS.

AI usage

Claude Code found the duplicated session overrides. I set the design direction and edited the issue.

rtibbles avatar Jul 23 '26 21:07 rtibbles

The bot has been waiting for a response for 2 hour(s). It will resume automatically when someone replies.

rtibblesbot avatar Jul 24 '26 02:07 rtibblesbot