title: Setting session timeout in Odoo 8
body: <p>I need to set a session timeout in Odoo 8. This could be done in Odoo 7 by modifying the time in session_gc method in http.py. But I tried the same in Odoo 7 and it doesn't seem to be working. I would like to know if anyone has a solution to this. The following is the code that I modified in openerp 7 to get this done.</p>
  
  <pre><code>def session_gc(session_store):
  if random.random() &lt; 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) &lt; last_week:
                  os.unlink(path)
          except OSError:
              pass
  </code></pre>
  
  <p>Here x is the no of seconds for session timeout. This seems to be working fine when i'm running on port 9069 but on the default port, it throws up an error.</p>
  
  <p>P.S: Either this, or I need a method to logout a user based on a particular date. I have done this by overriding the authenticate method but the problem arises if the user leaves it logged in. The authenticate checks only upon login time.</p>
  
  <p>Thanks And Regards,</p>
  
  <p>Yaseen Shareef</p>