Reputation: 266
I want to automatically logout from OpenERP session if session time is more than 30 min.
Upvotes: 2
Views: 996
Reputation: 767
This can be done by editing the session_gc
method in .../addons/web/http.py
. The following code illustrates your need -- remove or comment out the if
condition (and un-indent the following lines accordingly):
def session_gc(session_store):
#if random.random() < 0.001:
# we keep session one week
last_week = time.time() - x
for fname in os.listdir(session_store.path):
path = os.path.join(session_store.path, fname)
try:
if os.path.getmtime(path) < last_week:
os.unlink(path)
except OSError:
pass
The x
is the number of seconds for timeout as per your need.
Upvotes: 6