Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
6671 มุมมอง

Hi good day all.

My requirement is that after x number of minutes the system should logout and ask for relogin just like web-sessions. I tried to work with below piece of code in http.py but it is not working. Can anybody guide me how this can be done. 


def session_gc (session_store): 
if random.random () < 0.001 :
# we keep session one week
last_week = time.time () - 60 * 60 * 24 * 7
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

อวตาร
ละทิ้ง

For security, session auto-timeout should be a default option in base Odoo... it's pretty ridiculous that it's not.

ผู้เขียน คำตอบที่ดีที่สุด
Thank you @Niyas Raphy i installed it and changed the default 7200 seconds (2 hours) to my 60 seconds (1 minute) but it did not kill the session.
อวตาร
ละทิ้ง
ผู้เขียน

sorry my bad. @Niyas Raphy it is working. Thank you.

คำตอบที่ดีที่สุด

Hi,

You can use this available free module for the same: Inactive Sessions Timeout


Thanks

อวตาร
ละทิ้ง

@Niyas Raphy its not working for me i am using on odoo 14 ent please help

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.ย. 21
3254
0
ก.ย. 19
4521
0
ก.พ. 21
1824
0
ต.ค. 20
4004
1
มี.ค. 15
5273