Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet

1. Session Timeout After Inactivity

I would like to configure Odoo so that a user is automatically logged out after a defined period of inactivity (e.g., 15 minutes or 1 hour). I am aware that Odoo uses session-based authentication, and sessions are stored in the ir.sessions table.

  • Is there a built-in configuration option or a recommended way to define session lifetime?
  • If I modify session_lifetime in the Odoo config file (odoo.conf), does it effectively control this behavior?
  • session_lifetime = 3600  
  • Will setting this value also ensure forced logout in case the user stays idle?

2. Terminate Session on Browser Close or Tab Close

Additionally, I want to ensure that the user session is terminated immediately if the browser tab or window is closed (like logging out or invalidating the session token).

  • I understand this is tricky with standard HTTP (as it's stateless), but is there any suggested workaround or custom module that can help detect tab/window close and notify the server to end the session?
  • Can this be achieved using window.onbeforeunload or navigator.sendBeacon() in a custom JS module in Odoo?
  • Are there any security risks or side effects of forcing logout on tab close?

Environment:

  • Odoo Version: [Odoo 18]


Avatar
Verwerfen
Beste Antwort

adding session_lifetime = 3600 in the configuration file (value in seconds)

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
3
Sept. 25
1416
2
Sept. 20
6526
0
Feb. 25
1146
0
Nov. 15
6244
0
Apr. 25
1206