Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
6603 Lượt xem

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

Ảnh đại diện
Huỷ bỏ

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

Tác giả Câu trả lời hay nhất
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.
Ảnh đại diện
Huỷ bỏ
Tác giả

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

Câu trả lời hay nhất

Hi,

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


Thanks

Ảnh đại diện
Huỷ bỏ

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 9 21
3198
0
thg 9 19
4492
0
thg 2 21
1746
0
thg 10 20
3944
1
thg 3 15
5227