Every company that uses an ERP system eventually needs to end all active sessions quickly. It could be a module update, a data migration, a security incident or a configuration change after which you want to be sure that nobody is working on an old session. In this article, we show you how to log out all users in Odoo, which methods you can choose from and what to watch out for so you don't lose unsaved data.
Want to test the solutions described here on your own database? Try Odoo for free and practice them in a safe test environment.
Why is it worth knowing how to log out all users?
By default, Odoo keeps a user session active for a long time (the session cookie can be valid for several dozen days), so people logged in on different devices stay active without logging in again. Ending all sessions at once is sometimes necessary in a few typical situations:
- System or module updates – you want to be sure that nobody is working on records while changes are being made.
- Changes to permissions and access rules – you want to make sure everyone is already working with the new settings rather than with an old view opened earlier.
- Security incident – a suspected account takeover, a stolen device or a leaked password.
- Maintenance work and backups – a consistent database state without parallel user operations.
Important information before you start
Before you end everyone's sessions, let your team know about the planned downtime. Users who are filling in forms at that moment (e.g. sales orders or invoices) may lose unsaved changes. A good practice is to choose a time outside peak working hours and to send a notice in advance by email or through internal chat.
Method 1: Log out your own sessions from all devices
Odoo allows each user to end their own sessions on all devices at once. This solution is useful when the problem concerns a single account rather than the whole organization. It works in all Odoo variants: Online, Odoo.sh and on-premise.
How do you do it?
- Click your avatar in the top right corner and select My Profile (in older versions My Preferences).
- Go to the Account Security tab.
- Click the Log out from all devices button and confirm the action.
This method works for a single account only, so it won't solve the problem when you need to log out all users at once.
Method 2: Clear session files on the server
The most effective way to end the whole team's sessions is to delete the stored sessions from the server. In self-hosted (on-premise) installations, Odoo stores sessions by default as files in the data directory (data_dir/sessions). Simply restarting the service does not log users out, because the session files survive the restart. Only after they are deleted will each user be redirected to the login screen.
Sample procedure
- Notify users about the technical downtime.
- Make a backup of the database.
- Stop the Odoo service, e.g. with the command
sudo systemctl stop odoo. - Delete the files in the
sessionsdirectory inside the Odoo data directory. Do not delete thefilestoredirectory, because it contains attachments. - Start the service again:
sudo systemctl start odoo.
If Odoo runs on several servers or in Docker containers, make sure you clear the correct, shared sessions directory (or volume) on all nodes. Otherwise, some users will remain logged in.
On Odoo.sh, restarting the environment alone does not guarantee that sessions are cleared. Use the shell in the platform dashboard and delete the session files from the data directory. On Odoo Online you have no access to the server, so use the methods described below or contact the Odoo support team.
Carrying out such operations on a production server can be risky without experience, so we are happy to help you perform them safely.
Method 3: Invalidate sessions by changing login credentials
The session token in Odoo is tied to the user's authentication credentials. Changing a password or login invalidates the existing sessions of that account. Archiving a user works similarly, as it blocks their access to the system.
When does this method make sense?
- When it concerns a selected group of accounts, e.g. subcontractors or temporary employees.
- When you suspect a security breach affecting specific users.
- When you don't have access to the server (e.g. on Odoo Online) but you do have administrator rights.
To do this, go to Settings → Users & Companies → Users, open the selected account and use the Change Password action, or archive the user. Keep in mind that after archiving, the user cannot log in again until the account is restored, and after a password change they need to learn the new login details.
Want to see what user and session management looks like in the latest version? Try Odoo for free with your own test data.
How do you secure the system after logging users out?
Ending sessions is only the beginning. If the reason was a security incident, it is worth strengthening account and system access protection:
- Reset the passwords of compromised accounts and enable two-factor authentication (TOTP) for users.
- Restrict the addresses from which users can log in – see our guide on how to restrict login IP addresses in Odoo.
- Verify who has access to technical settings – this article will help: how to restrict access to system settings.
- Organize roles and permissions using user profiles in Odoo.
Best practices
- Plan maintenance windows and communicate them in advance.
- Back up your data before every operation on the server.
- Test in a staging environment before running the procedure in production.
- Document the procedure so that in an emergency every administrator knows what to do.
- Apply the principle of least privilege – the fewer people with administrative access, the lower the risk.
Most common mistakes
The most common mistakes include clearing sessions during working hours without warning, deleting the wrong directory (e.g. filestore) instead of the session files, and not having a backup. Administrators also sometimes assume that simply restarting the service will log users out, or they clear sessions on only one of several servers. After a permissions change, it is usually enough for users to refresh their browser, while a full logout is needed mainly for security or maintenance reasons.
FAQ – frequently asked questions
Is there a single button in Odoo that logs out all users?
The standard interface has no single button for the whole organization. A user can end their own sessions in the Account Security tab, while an administrator usually clears the session files on the server or invalidates the sessions of individual accounts by changing their login credentials.
Will users lose unsaved data?
Yes, people who are editing forms without saving at the moment of logout may lose their changes. That is why it is worth informing the team beforehand and choosing the right moment.
Can I log out users in Odoo Online?
On Odoo Online you have no access to the server, so you cannot clear session files yourself. You can use the options available in the interface, such as changing passwords or archiving accounts, or contact Odoo support.
Will restarting the Odoo server log users out?
No. Sessions are stored as files on disk by default, so users remain logged in after the service restarts. To log them out, you need to delete the session files.
Summary
To effectively log out all users in Odoo, choose the method that fits your installation type: clearing session files for self-hosted environments and Odoo.sh, and changing login credentials or archiving accounts where you have no server access. Whichever option you choose, always make sure you have a backup and communicate with your team in advance.
Need support with security configuration, implementation or maintenance of Odoo? The KK Innovations team will help you plan and safely carry out any change – contact us today.