Odoo Help


Settings to session timeout?

Mohamed arif
on 3/21/13, 10:43 AM 21,292 views


Is there any option to set time for automatically logout or expire session if no user activity is monitored (say 10 minutes)? If the user forget to logout and keeps signed in will cause issues, because the others can access data.

Does OpenERP have the feature to sign out remotely?


openerp version ?

Cyril Gaspard (GEM)
on 3/24/13, 6:28 AM

Thanks for your response, it is for version 7.

Mohamed arif
on 3/24/13, 6:33 AM

I tested doesn't work with timeout in config file or modify socket timeout.

Cyril Gaspard (GEM)
on 3/24/13, 7:32 AM

update my answer with link

Cyril Gaspard (GEM)
on 3/24/13, 8:04 AM

see, my answer, in the link you have a solution. Bye

Cyril Gaspard (GEM)
on 3/29/13, 9:00 AM
Mohamed arif
On 5/13/13, 9:01 AM

I found solution by modifying code in web/http.py

I updated following with code in the function def session_context(request, session_store, session_lock, sid):

for key, value in request.session.items():
    if not isinstance(value, session.OpenERPSession):
    if getattr(value, '_suicide', False) or (
               #not value._uid
            not value.jsonp_requests
           # FIXME do not use a fixed value
           and value._creation_time + (10 * 60) < time.time()):
        _logger.debug('remove session %s', key)
        del request.session[key]
        value._creation_time = time.time()

It expires session automatically in 10 minute if user keeps browser idle.

Thanks Arif. It really worked.

Sudhir Arya (ERP Harbor Consulting Services)
on 7/1/13, 3:09 AM

Dear Arif, we followed your instructions with no luck, we have only to change this code on /addons/web/http.py ? or are we missing something? Thanks!

on 7/10/13, 1:37 AM

@ sudhir. This code doesnt works for me. any other configuration needed?

on 7/19/13, 7:16 AM

I don't know but this code worked for me.

Sudhir Arya (ERP Harbor Consulting Services)
on 7/20/13, 12:41 PM

How to do this for a particular db,Not for all the db.I mean how to create a custom module for this session time out.What are the steps i can follow please help...

on 2/5/15, 4:13 AM

How to create a new module using inheritance web/http.py method...

on 2/5/15, 4:15 AM

Thanks arif, this code works for me :D

on 10/1/15, 5:05 PM

Cyril Gaspard (GEM)

--Cyril Gaspard (GEM)--

| 5 6 8
Paris, France
--Cyril Gaspard (GEM)--

Forum contributor since 2008

Cyril Gaspard (GEM)
On 3/24/13, 7:57 AM

I do get once in a while a message that my session has expired. I use the trunk of V7.0

on 3/29/13, 9:52 AM
Mohamed arif
On 3/24/13, 8:00 AM

I see some similar code which keep session for one week. File web/http.py, Line : 435

last_week = time.time() - 60*60*24*7

I am checking these codes.


About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

3 follower(s)


Asked: 3/21/13, 10:43 AM
Seen: 21292 times
Last updated: 3/27/15, 6:36 PM