Why Open edX session timeouts need a deliberate setting
An inactivity timeout ends an Open edX session after a set period without user activity, so a learner or course author who walks away from a shared lab computer does not leave the LMS or Studio open to the next person. Teams usually need one for two reasons: a shared device, or an internal security policy that caps how long an administrative or instructor session can stay open. Getting this right is not only a platform change. The work covers the Open edX setting that governs the LMS and Studio sessions, and the identity provider that often holds the real sign-in state behind them. Both need explicit values, owners and tests.
The platform side sits in edx-platform, which is licensed under AGPL-3.0 and built on Python, JavaScript and Django. Session behavior comes from Django session handling, and the inactivity logic is implemented through session middleware. The setting SESSION_ACTIVITY_SAVE_DELAY_SECONDS controls how often session activity is written back, and it was added in the Ulmo release. Before you change any value, confirm the exact key name, its default and its effect in the release you run, because the latest named release is the only supported release. Read the Open edX release notes for the release in use and record the values you set in version control.
Platform timeouts alone can leave a gap. If learners or staff sign in through SAML 2.0, OAuth2 or another identity provider, the provider may keep its own session alive after the LMS has expired its session. The user can then return and be signed in again without a password prompt. Decide which system is the authority for each audience, then set the LMS and provider timeouts to match, or deliberately document why they differ. Ask your identity team to confirm session lifetimes, idle timeouts and single logout behavior, and test with a real browser on a shared-device scenario before the policy goes live.
Which timeout setting fits each session type
This table compares the four places an Open edX inactivity or expiry rule can live, from the session inactivity middleware to the identity provider's own session lifetime. Read each row for what it controls, which sessions it reaches and when it is the right choice. The main takeaway is that a timeout set in one layer does not govern the others, so the LMS, Studio and SSO settings have to be aligned on purpose.
| Setting | What it controls and which sessions it affects | Main trade-off | When it fits |
|---|---|---|---|
| Session inactivity middleware | Logs out a signed-in user after a period with no requests. Applies to LMS and Studio sessions that pass through the middleware. Confirm the middleware path and timeout key in your release. | Idle detection depends on request activity, so long-running client-side pages may look idle to the server. | Enforcing a consistent idle limit on learner and staff sessions within the Open edX site itself. |
| SESSION_ACTIVITY_SAVE_DELAY_SECONDS (added in Ulmo) | Sets how often session activity is written back to the session store, which affects how precisely inactivity is measured. Confirm the default value in the Ulmo release and your deployment. | A longer delay reduces session store writes but makes the recorded last-activity time less precise, so users may be logged out slightly late or early. | Tuning write load on busy sites while keeping inactivity limits accurate enough for your policy. |
| Django session expiry settings | Controls session cookie age and whether sessions end when the browser closes. These apply to every Django session, including admin sessions. Confirm current setting names and defaults in your Django and Open edX versions. | Absolute expiry ends sessions even for active users, which can interrupt a learner mid-course or a staff member mid-edit. | Setting a hard maximum session lifetime, especially for staff and Django admin access. |
| Identity provider session lifetime | Controls how long the SSO session stays valid at Keycloak, Entra ID or another SAML or OAuth2 provider. It does not end the Open edX session on its own. Confirm the provider's idle and maximum settings. | If the provider session lasts longer than the Open edX session, users may re-enter nothing but still get signed back in silently, which weakens the intended limit. | Centralizing timeout and MFA policy when Open edX sign-in is delegated to SSO. |
How the inactivity middleware decides a session has gone idle
The inactivity middleware treats a session as idle when no authenticated request has arrived for longer than the configured timeout. On each request from a signed-in user, the middleware compares the current time with the last-activity timestamp stored for that session. If the gap is longer than the limit, the session is ended and the user must sign in again. If the gap is shorter, the request goes through and the timestamp is refreshed. The timeout is measured from the last recorded activity, not from the time of sign-in, so a learner who keeps the course player open but stops sending requests will still be logged out once the window passes.
The setting SESSION_ACTIVITY_SAVE_DELAY_SECONDS controls how often that last-activity timestamp is written back to the session store. Without a delay, every authenticated request would produce a write, which adds database load on busy platforms where learners make many small API calls. With a delay, the timestamp is only saved when the previous save is older than the chosen number of seconds. Fewer writes reduce load, but the stored timestamp can lag behind real activity by up to that delay. The practical effect is that the effective timeout can look slightly longer than the configured value, because a user who was active during the delay window has a stored timestamp that is older than their true last request.
Treat the exact behavior as something to confirm, not assume. Check the Open edX release notes for the release you run, and read the middleware and session code in that release's edx-platform source, since the setting and its defaults are tied to the named release in use. Ask your implementation team to document the value you choose, the timeout it works with, and the worst-case gap between a user's last request and logout. That number is what your security team will need when they compare the platform's behavior with your own session policy.
How LMS sessions and SSO sessions interact
The flow starts when a learner signs in through an external identity provider over SAML, OAuth2 or another supported protocol. The LMS then creates its own session cookie, and that session carries the inactivity clock. Each learner request updates the LMS session, while the identity provider session continues on its own timer. Check that the LMS inactivity limit and the identity provider limit agree, because the LMS can log a learner out while the identity provider still treats them as signed in.
Learner sign-in, LMS session activity and timeout across the identity provider boundary.
Setting Open edX session timeouts in a Tutor deployment
This sequence sets inactivity timeouts for Open edX sessions in a Tutor deployment, from release and baseline checks through verified logout on each domain. It also aligns the identity provider session so learners and staff do not meet conflicting expiry times. Run it on staging first, then repeat the verification in production.
Confirm the release and Tutor version
Record the Open edX named release and the Tutor version your site runs, then check that the two are compatible in the Tutor documentation. Open edX supports only the latest named release, and Verawood is the current one, so a site on an older release should plan an upgrade before it depends on the session settings in this sequence. Check the Open edX release notes for the session settings your release provides. Done when the release, Tutor version and available settings are written in the change record.
Record current session behavior in staging
On a staging copy of the site, sign in to the LMS and to Studio, leave each browser idle, and note how long each session remains valid before a forced sign-in. Repeat the test with a learner account and an instructor or author account, since staff sessions often behave differently. Check whether the LMS and Studio sessions expire independently, and record any session errors in the logs. Done when you have a baseline table of idle times per domain to compare against after the change.
Set the inactivity middleware and save delay
Using the Tutor configuration or a Tutor plugin that adds Django settings, enable the session inactivity middleware and set SESSION_ACTIVITY_SAVE_DELAY_SECONDS for both the LMS and Studio. Confirm the exact middleware path, the setting names and the accepted values for your release in the Open edX documentation before you write them, because this page does not state those details. Keep the change in version control so it can be reviewed and reverted. Done when the rendered settings on the staging host show the values you intended.
Apply the change to staging and restart
Save the Tutor configuration and redeploy the staging site so the LMS and Studio load the new settings. Restart every service that reads these settings, including Celery workers if your deployment runs them, so no process keeps the old values in memory. Watch the startup output for configuration errors. Done when every LMS and Studio container or pod reports the new configuration and the site starts without errors.
Verify idle logout on each domain
Repeat the baseline test from the second step. Leave a learner session and a Studio author session idle past the configured window, then reload a page on each domain and confirm the user must sign in again. Also confirm that activity inside the window keeps the session alive, and that signing out of one domain behaves as you designed. Review the LMS and Studio logs for session or cookie errors. Done when both domains expire on the configured timing and the logs show no new session errors.
Align the identity provider session lifetime
If sign-in is delegated to a SAML, OAuth2 or other identity provider, set that provider's session lifetime and idle timeout to match the Open edX values or to sit deliberately above them. Test two cases: the identity provider session is still valid while the Open edX session has expired, and the reverse. Confirm which state governs the next sign-in and document it for the security team. Done when both sessions end on the timing you chose and the test results are recorded.
Security risks of long or missing inactivity timeouts
Inactivity timeouts limit how long a signed-in session stays useful to someone who should no longer have it. The risks below share one cause: a session outlives the user's attention, role or trust, and the platform keeps honoring it. Each card names the control that reduces the risk and what to verify in your own Open edX environment.
Unattended browser on a shared device
A learner or instructor signs in on a library, lab or shared workstation and walks away. Without an inactivity limit, the next person can open the LMS or Studio with the first user's account. Set the inactivity middleware and confirm the limit in a real browser: sign in, leave the tab idle, and check that the next request requires sign-in again. Test on the same browser type your learners use.
Session reuse after role changes
A staff member moved to another team or a course author who lost instructor rights may still hold an active session. Role changes made in the database or identity provider do not always end existing sessions on their own. Ask your team to define how a revoked role is enforced, then test it: remove a staff flag, reload an open Studio page and confirm access is denied.
Long-lived Studio admin sessions
Studio sessions carry authoring rights over course content and often run for hours while a course team works. A forgotten admin session in Studio is a higher-impact target than a learner session. Agree a shorter timeout for course-authoring roles where your policy requires it, and verify that the timeout applies to Studio as well as the LMS, not only to one domain.
Mismatched timeouts with the identity provider
When sign-in is delegated to SAML, OAuth2 or another identity provider, the LMS session and the provider session can expire at different times. A user may still be signed in to the LMS after the provider session ends, or be asked to sign in again too often. Document which system owns the idle timer, align the values, and test a sign-out from the provider to confirm the LMS session behaves as your policy states.
Session data in database and cache
Session records persist in a backing store, and a shared cache serves multi-node deployments. Long retention of expired sessions, or a cache with no eviction policy, widens what an attacker can read after a compromise. Confirm where sessions are stored in your deployment, how expired entries are cleaned up, and who can read the cache or database. Restrict access to those stores as you would any store holding credentials.
Timeout choices for learners, course staff and administrators
Learners usually work in short, irregular sessions across lessons, videos, discussions and assessments, often on shared or mobile devices. A short inactivity timeout protects learner accounts on public or shared computers, but it can interrupt someone reading a long page or working through a problem set, and a lost unsaved answer damages trust in the course. A long timeout keeps learners signed in longer, which raises exposure on shared devices. Timed exams and proctored assessments add a separate concern: the timeout must not end an exam attempt in a way that loses answers or breaks the attempt record.
- Usage pattern: Frequent short visits with idle periods while reading or watching video.
- Short timeout risk: Interrupted lessons, lost work in open response questions and support requests.
- Long timeout risk: Accounts stay open on shared or borrowed devices.
- Long-running activities: Confirm how timed exams save progress when a session ends, and test that behavior before launch.
- Settings to confirm with the business owner: The acceptable timeout for public versus institutional learners and whether any course needs a different value.
Before changing the learner value, ask the business owner which course types carry the most risk and run a test course with a timed assessment to see what the learner experiences.
Course teams build content in Studio over long editing sessions, often with large course outlines, multiple video uploads and unsaved changes across several components. A timeout that ends a session in the middle of an edit can lose work or force a re-login at a bad moment. Studio users also hold elevated permissions to change course content, so a long timeout on an unattended workstation creates a different risk: someone else could edit a course under the author's account. The right value depends on how authors work and where they work.
- Usage pattern: Long, continuous editing sessions with frequent saves and some uploads.
- Short timeout risk: Lost edits and interrupted uploads during content authoring.
- Long timeout risk: Unattended workstations with elevated course rights remain open.
- Long-running activities: Large imports and video uploads may run longer than an inactivity window, so confirm how they behave when a session expires.
- Settings to confirm with the business owner: Whether authors use managed devices, whether course teams share accounts (which should not happen) and who approves a Studio-specific value.
Before changing the Studio value, have course leads test a realistic authoring session, including an upload, and record whether any edits are lost.
Platform administrators hold the highest privileges, including access to the Django admin interfaces on the LMS and Studio. Their sessions carry the greatest risk, so they usually warrant a shorter inactivity timeout than learners or authors. The trade-off is operational: administrators run maintenance, investigate incidents and sometimes wait on long jobs, and a very short timeout can force repeated sign-ins during an incident. Administrator timeouts should also match the sessions in the identity provider, so that closing or expiring one session does not leave another open.
- Usage pattern: Intermittent, high-privilege sessions for maintenance, support and incident response.
- Short timeout risk: Repeated re-authentication during incidents and interrupted long-running commands.
- Long timeout risk: Privileged sessions left open on administrator workstations.
- Long-running activities: Confirm whether maintenance tasks run in a terminal or browser session that the web timeout can end.
- Settings to confirm with the business owner: The administrator timeout, whether it differs from the learner value and how it aligns with SSO session lifetimes and MFA prompts.
Before changing the administrator value, confirm with the security owner how administrator sessions are recorded and whether the identity provider enforces its own timeout.
What to confirm in your environment before changing timeouts
A timeout that looks correct in a settings file can behave differently once it passes through a cache, a proxy, an identity provider and a rolling deployment. The cards below list the points to verify with vendor documentation or a test in a non-production environment before you change a value for learners or staff.
Confirm the release includes the setting
The SESSION_ACTIVITY_SAVE_DELAY_SECONDS setting was added in Ulmo, so a site running an earlier release will not honor it even if the value is written into configuration. Check the release notes for the named release you run, then confirm the setting is read by the version actually deployed. Open edX supports only the latest named release, so a timeout plan also depends on the upgrade path you expect to follow.
Check how the cache stores sessions
Session data and the activity timestamps that drive inactivity checks live in the cache or database your deployment configures. On multi-node deployments, a shared Django cache backend such as Redis or Memcached must be in place so that every web node sees the same session state. Confirm which backend holds sessions, its eviction and expiry behavior, and whether a cache restart logs every learner out.
Test behavior behind proxies and load balancers
Inactivity is measured from requests the application receives, so a proxy that serves cached assets, long-polling endpoints or health checks can keep a session alive or fail to refresh it. Confirm which paths count as activity in your setup, whether sticky sessions are used, and whether the load balancer applies its own idle timeout that cuts connections before the platform expires the session.
Review mobile apps and external LTI tools
Native mobile clients, embedded LTI tools and background requests from third-party content may or may not refresh the learner's Open edX session. Some clients use tokens with their own lifetimes, and an LTI launch can start a session in a different context. Test each entry point you expect learners to use, record which ones extend the session, and decide whether that behavior is acceptable for your risk profile.
Align with the identity provider session
When sign-in is delegated to SAML, OAuth2 or another identity provider, the provider keeps its own session and may re-authenticate users on a different schedule. A short Open edX timeout combined with a long provider session can mean users are silently signed back in, while the reverse can prompt repeated logins. Confirm the provider's session lifetime, single sign-out support and idle behavior, and test both directions before publishing a policy.
Supported identity providersMeasure timeouts during a rolling deployment
A rolling deployment replaces web pods or servers gradually, so learners may be served by old and new code during the same session. Confirm whether session serialization or cache keys change between versions, whether a deployment invalidates existing sessions, and how the timeout behaves when a pod is removed mid-session. Run the test during a staging rollout to see what learners would experience.
Open edX session timeout questions buyers ask before hiring help
Can our internal team set Open edX session timeouts without outside help?
Yes, if one engineer owns the change and has a staging site that matches production. The configuration itself is small: the session inactivity middleware and the SESSION_ACTIVITY_SAVE_DELAY_SECONDS setting, which was added in Ulmo. The harder part is deciding the policy and proving it works across the LMS, Studio, the micro-frontends and any single sign-on session. Teams that already run Tutor and maintain their own configuration usually find the change manageable. Teams without a test process or a second environment tend to find the verification takes longer than the edit.
What drives the effort of an Open edX session timeout change?
Effort rises with four factors:
- The number of identity providers, since each sign-in path can keep its own session and must be checked.
- Custom authentication, such as a custom third-party auth pipeline or a local login override.
- The number of environments that need the same policy, including staging, production and any regional sites.
- Test coverage, meaning whether someone has already written scripted checks for idle logout, token refresh and re-login.
A single site with one provider and no custom login code is the simplest case. Ask any partner to show which of these factors applies to your platform before agreeing on a scope.
How long does a session timeout change need to be tested?
The testing length depends on the number of sign-in paths, browsers and roles you must cover, so no fixed duration applies. Plan for time to test idle logout on learner and staff accounts, confirm that long-running pages such as video or assessments behave as your policy requires, and check that re-authentication works through your single sign-on provider. Ask the partner to list the test cases and the environments where each one runs, then compare that list with your own risk review. A timeline without that list is not something you can check.
What does the client need to provide for this work?
The work needs a named policy owner who decides the idle time limit, warning behavior and whether administrators get a shorter limit than learners. It also needs test accounts for each role, a staging site that mirrors production settings, and admin access to the identity provider so the single sign-on session lifetime can be aligned. Without the identity provider access, the timeout in Open edX may end while the provider session is still active, which can leave a user signed in without a visible reason. Confirm each of these items in the written scope before work starts.
Is a session timeout a one-time setting or does it need review after upgrades?
It is both. The configuration is set once, but it should be checked after each Open edX upgrade, because session handling, middleware order and frontend login behavior can change between named releases. Open edX supports only the latest named release, so every upgrade is a chance for the timeout behavior to shift. Add a short regression check to your upgrade runbook: confirm idle logout, token refresh and re-login on staging before production. Ask your partner whether post-upgrade checks are included or sold as a retainer.
Does a session timeout change affect compliance evidence?
It can. Many buyers in regulated sectors need to show that inactivity limits exist, are documented and are enforced consistently. DeployOpen prepares systems, controls and evidence for compliance assessments, but it does not issue audit reports or certifications. Ask your independent auditor which evidence they expect, such as the written policy, the configuration record, test results and change approvals. Keep those records together so the setting can be shown during an assessment.
What should a quote for session timeout work list?
A quote should follow from a written scope and list the deliverables in plain terms. Look for the policy decisions covered, the Open edX environments in scope, each identity provider that must be aligned, the test cases and roles covered, the staging and production changes, and the handover documentation. It should also state what the client must provide, which items are one-time and which recur, such as post-upgrade checks, and how retests are handled. If a line item cannot be tied to one of these elements, ask for it to be defined.
Should we align the Open edX timeout with the SSO session or keep them separate?
Align them unless you have a documented reason not to. If the identity provider keeps a session alive longer than Open edX, a user can return to the platform and be signed in silently, which may conflict with your policy. If Open edX times out sooner, learners may be surprised by re-login prompts during active use. Agree on which system owns the idle limit, then set the other to match. This decision belongs to the policy owner and should be recorded before any configuration changes.
How DeployOpen scopes and delivers Open edX session timeout work
DeployOpen treats session timeouts as a scoped piece of work on your own Open edX deployment, covering the inactivity middleware, the SSO session alignment and the checks that prove it works. Engagements are fixed-scope, so the scope, deliverables and timeline are agreed in writing before any configuration changes begin.
How we scope
- Confirm which Open edX release you run, since the timeout setting depends on the release line you are on.
- Map which sites, roles and entry points (LMS, Studio, MFEs, admin) must share one inactivity policy.
- Record the identity provider and its session lifetime so the written scope covers both sides of sign-in.
How we build
- Configure the session inactivity middleware and its save-delay setting in your Tutor-based deployment, documenting each value and its reason.
- Align the Open edX timeout with SSO session lifetimes so logout and re-authentication behave the same way for users.
- Test idle, active and cross-application sessions in a staging environment that mirrors production before any change goes live.
How we hand over
- Deliver a written configuration record listing each timeout value, the file or setting it lives in and the owner.
- Provide a test script your team can rerun after upgrades, Tutor changes or identity provider changes.
- Walk your operations and security staff through the rollback steps and the places where timeouts are overridden.
How we support
- Support is available as a retainer for timeout changes, upgrades and retesting after release updates.
- Retainers can include periodic retesting of session behavior as the identity provider and platform change.
- Ask for the support scope, response expectations and retest frequency in the written quote before you sign.

