Skip to Content

Odoo 19 Session & Timeout: Setup and Account Security

November 20, 2026 by

Everyone who logs in to an ERP system creates a session, which is the link between the browser and the server. If an employee leaves an unlocked computer unattended, an open session can become a real threat to company data. That is why session and timeout in Odoo is a topic worth sorting out as early as the implementation stage. In this article, we explain how sessions work in Odoo 19, which settings you can change on your own, and when technical intervention is needed.

Want to try the described features in practice? Create a free instance and test the security settings with your own data.

Try Odoo for free

How does a user session work in Odoo?

After a successful login, Odoo creates a session and stores its identifier in a browser cookie (session_id). On the server side, session data is stored and linked to the user, the database, and a session token, which is calculated, among other things, from authentication data. As long as the session is valid, the user does not have to enter a password with every click.

In a standard configuration, a session stays valid for a long time: by default, the cookie and session files are valid for about 7 days, and old session files are periodically removed by the server. Odoo has no single field in the interface like "log out after 15 minutes of inactivity." Session behavior is therefore controlled at several levels: account settings, server configuration, and, if needed, a dedicated module.

What can you configure without programming?

Before turning to technical solutions, use the options available in the admin panel and in user preferences.

Password policies and two-factor authentication

In the menu Settings → General Settings, in the Permissions section, you will find, among other things, the password policy, i.e. the minimum password length. Two-factor authentication (2FA) is enabled by the user in their preferences, in the account security tab. 2FA significantly reduces the risk of account takeover, but it does not shorten the session lifetime. We describe it in detail in the article Two-Factor Authentication (2FA) in Odoo 19.

Managing your own sessions and devices

In the user preferences, in the account security tab, you can change your password, manage API keys, and review the devices and active sessions linked to your account. There is also an option to log out from all devices, which is useful after losing a phone or working on someone else's computer. The exact appearance of this section may depend on the version and edition, so check it in your own instance.

Access control as part of session security

Even if a session remains open, the user will only see what their access rights allow. That is why it is worth setting up a proper access model and granting each person only the necessary permissions. These articles will help: how to create custom access groups and how to restrict access to menus.

How do you set a session timeout on the server?

Session lifetime and logout after inactivity are elements that Odoo configures outside the standard interface. Depending on how you host Odoo, you have several options.

Odoo on-premise

With your own server, you can modify session behavior in a dedicated module that overrides the default session lifetime, or use a ready-made community module (e.g. auth_session_timeout from the OCA project, if it is available for your Odoo version). Test any such solution before deploying it to production. Also remember to set the correct data directory (data_dir), where session files are stored. With multiple application servers behind a load balancer, sessions must be shared or pinned to a specific server; otherwise, users will be logged out at random.

Reverse proxy and cookies

If Odoo runs behind Nginx or a similar proxy, make sure the proxy_mode parameter is enabled and the connection uses HTTPS. This way, the session cookie is transmitted only over an encrypted channel and is harder to intercept on the network. The proxy may also enforce additional connection time limits, but it does not replace inactivity logout logic.

Odoo Online and Odoo.sh

In Odoo Online, you cannot upload custom modules or change the server configuration, so rely on the standard settings: 2FA, strong passwords, manual device logout, and well-designed access rights. In Odoo.sh, you can deploy a custom module, but every change should pass testing in a staging environment.

Configuring sessions in production requires caution, because a mistake can log out all employees in the middle of the day. If you want to implement it without risk, get help from an experienced team.

Contact us

Best practices for sessions and timeouts

  • Match session length to the role. Accounting staff and administrators should have shorter sessions than warehouse employees working on terminals.
  • Enable 2FA at least for accounts with broad permissions.
  • Enforce HTTPS and configure the proxy correctly.
  • Do not share passwords. Each employee should have their own account, and shared terminals should be protected with a shorter session time.
  • Train users. Logging out after finishing work is the simplest way to protect data.
  • Revoke access immediately when an employee leaves the company, e.g. by archiving their account instead of waiting for the session to expire.

Monitoring logins and activity

Session configuration is only half the work. It is worth regularly checking who logged in to the system and when. In the article Odoo Login History we show how to review login history, and in the article User Activity Audit in Odoo 19 we describe auditing user changes and activity. Combining these tools lets you quickly detect suspicious logins, e.g. at unusual hours or from new devices.

When a vacation replacement requires temporary permissions, instead of sharing a password it is better to use delegation, which we described in the article Delegating Permissions in Odoo 19.

Want to see what the security settings panel and user management look like? Try Odoo with no commitment.

Try Odoo for free

The most common session problems

Users are logged out at random

The most common causes are the lack of a shared session store with multiple servers, a change of the database security key (database.secret) or server configuration, service restarts, and an incorrectly configured proxy. Check the server logs and the proxy_mode configuration.

The session does not expire as quickly as expected

By default, Odoo keeps a session for several days rather than ending it after the first period of inactivity. If you need a shorter limit, it requires a technical modification or an additional module.

FAQ – frequently asked questions

Can Odoo automatically log users out after inactivity?

The standard interface does not offer such a field. Logout after inactivity can be implemented with a dedicated module or server configuration changes, depending on the hosting type. In Odoo Online this is limited, because you cannot install custom code.

How do I log a user out from all devices?

Users can do this in their preferences, in the account security section. Changing the password also invalidates existing sessions, and an administrator can additionally archive the account, which cuts off access immediately.

Does 2FA replace session timeout?

No. 2FA protects the moment of login, while a timeout reduces the risk caused by leaving a session open. It is best to use both mechanisms together.

Summary

A good session and timeout configuration in Odoo 19 combines account settings, server security, and deliberate permission management. Start with 2FA, organize your access groups, and then adjust the session lifetime to your company's needs and chosen hosting method.

Need help implementing a secure Odoo configuration? The KK Innovations team will gladly advise you and prepare a solution tailored to your company.

Contact us