Odoo Help

Welcome!

This community 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.

2

Settings to session timeout?

By
arif
on 3/21/13, 10:43 AM 15,093 views

Hi,

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?

Thanks

openerp version ?

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

Thanks for your response, it is for version 7.

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
2
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):
        continue
    if getattr(value, '_suicide', False) or (
               #not value._uid
           #and
            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)
        removed_sessions.add(key)
        del request.session[key]
    else:
        value._creation_time = time.time()

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

Thanks Arif. It really worked.

Sudhir Arya (SA)
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!

Santiago
on 7/10/13, 1:37 AM

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

Remya
on 7/19/13, 7:16 AM

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

Sudhir Arya (SA)
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...

Odoo
on 2/5/15, 4:13 AM

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

Odoo
on 2/5/15, 4:15 AM

Thanks arif, this code works for me :D

Gustavo
on 10/1/15, 5:05 PM
1

Cyril Gaspard (GEM)

--Cyril Gaspard (GEM)--
4136
| 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

patrick
on 3/29/13, 9:52 AM
0
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.

Thanks

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

3 follower(s)

Stats

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